Changeset 25437 in project


Ignore:
Timestamp:
10/27/11 06:01:21 (9 years ago)
Author:
Ivan Raikov
Message:

9ML-toolkit: bug fixes to sxml representation handling

Location:
release/4/9ML-toolkit/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/9ML-toolkit/trunk/9ML-toolkit.setup

    r25361 r25437  
    55
    66(required-extension-version 'getopt-long 1.9)
    7 (required-extension-version 'miniML 1.4)
     7(required-extension-version 'miniML 1.7)
    88(required-extension-version 'signal-diagram 1.5)
    99
    10 (define version 1.5)
     10(define version 1.6)
    1111
    1212(make (
  • release/4/9ML-toolkit/trunk/SXML.scm

    r22119 r25437  
    2525  (let ((v ((select-first-kid (lambda (x) (not (eq? (car x) '@)))) node)))
    2626    (if (not v)  (error 'sxml:kid "node does not have children" node)  v)))
     27
     28;; obtain the first non-attribute child / return #f if there are no children
     29(define (sxml:kid* node)
     30  ((select-first-kid (lambda (x) (not (eq? (car x) '@)))) node))
    2731 
    2832;; obtain the cadr of the first non-attribute child
  • release/4/9ML-toolkit/trunk/repr.scm

    r25365 r25437  
    13031303          (let ((entry (car eval-env)))
    13041304            (if (filter entry)
    1305                 (let ((v (cdr entry)))
     1305                (let ((v (cdr entry))
     1306                      (name (ident-name (car entry))))
    13061307                  (cond ((MLvalue? v)
    13071308                         (let ((sxml-value (MLvalue->sxml v)))
    1308                            (let* ((name (sxml:attr sxml-value 'name))
    1309                                   (value (sxml:kid sxml-value))
    1310                                   (tuple-label ((sxpath '(Tuple left Const label *text*)) `(*TOP* ,sxml-value))))
     1309                           (let* ((value (sxml:kid* sxml-value))
     1310                                  (tuple-label (and value ((sxpath '(Tuple left Const label *text*)) `(*TOP* ,sxml-value)))))
    13111311                             (if (pair? tuple-label)
    13121312                                 (value-hook prefix name (car tuple-label) sxml-value)))))
     
    13341334             (cond ((MLvalue? v)
    13351335                    (let ((sxml-value (MLvalue->sxml v)))
    1336                       (let* ((name (sxml:attr sxml-value 'name))
    1337                              (value (sxml:kid sxml-value))
    1338                              (tuple-label ((sxpath '(Tuple left Const label *text*)) `(*TOP* ,sxml-value))))
     1336                      (let* ((value (sxml:kid* sxml-value))
     1337                             (tuple-label (and value ((sxpath '(Tuple left Const label *text*)) `(*TOP* ,sxml-value)))))
    13391338                        (if (pair? tuple-label)
    1340                             (value-hook prefix name (car tuple-label) sxml-value)))))
     1339                            (value-hook prefix (ident-name name) (car tuple-label) sxml-value)))))
    13411340                   (else #f))
    13421341             ))
Note: See TracChangeset for help on using the changeset viewer.