Changeset 25412 in project


Ignore:
Timestamp:
10/22/11 19:09:37 (9 years ago)
Author:
Alan Post
Message:

genturfahi: fix grouping operator when grouped around a single element.

The grammar:

a <- (,#\a #\b)?

Was returning "" when there was no match, and returning '(#\a) when
there was a match. The expectation is that it return #\a instead,
as there is only a single parse-tree modifying element in the group.

Correct this behavior so that the single token is returned, rather
than a list of that single token.

Location:
release/4/genturfahi/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/genturfahi/trunk/chicken-ext.scm

    r23157 r25412  
    4747   javni-valsi-val
    4848   javni-rodavalsi
    49    javni-rodavalsi-girzu
    5049   javni-rodavalsi-je
    5150   javni-rodavalsi-*
  • release/4/genturfahi/trunk/javni-valsi.scm

    r23157 r25412  
    3838;; single valsi as a result.
    3939;;
     40;; XXX: Ok, I have a difference between accepting an incoming
     41;;      list and that list being a group operator?  Or does this
     42;;      happen every time I accept a list when there are multiple
     43;;      incoming words?
     44;;
    4045(define (javni-rodavalsi rodavalsi)
    4146  (remove javni-nastura? rodavalsi))
    4247
    43 (define (javni-rodavalsi-girzu rodavalsi)
    44   (let* ((jalge (remove javni-nastura? rodavalsi)))
    45     (if (null? jalge) secuxna-nastura jalge)))
    46 
    47 
    48 ;; A routine used by the nunjavni-je procedure.  It returns
    49 ;; a single element if there is only one nastura in the result
    50 ;; list.
     48;; A routine used by the nunjavni-je, nunjavni-jonai, and nunjavni-?
     49;; procedures.  It returns a single element if there is only one
     50;; nastura in the result list.
    5151;;
    5252(define (javni-rodavalsi-je rodavalsi)
  • release/4/genturfahi/trunk/nunvalsi.scm

    r23157 r25412  
    6464
    6565    ((#f #f #f #t) (lambda (rodavalsi)
    66                      (javni-rodavalsi-girzu rodavalsi)))
     66                     (javni-rodavalsi-je rodavalsi)))
    6767    ((_  #f #f #t) (lambda (rodavalsi)
    68                      (make-javni-valsi cmene
    69                                        (javni-rodavalsi-girzu rodavalsi))))
     68                     (make-javni-valsi cmene (javni-rodavalsi-je rodavalsi))))
    7069
    7170    ((#f #f #f #f) (lambda (valsi) valsi))
Note: See TracChangeset for help on using the changeset viewer.