Changeset 21576 in project


Ignore:
Timestamp:
11/21/10 05:41:02 (9 years ago)
Author:
Alan Post
Message:

genturfa'i: don't return the matched token in and-predicate.

This is to match the behavior of the not-predicate. These rules are
used to control the parser, rather than to return results from the
parser.

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

Legend:

Unmodified
Added
Removed
  • release/4/genturfahi/trunk/nunjavni.scm

    r21574 r21576  
    187187(define (nunjavni-& javni)
    188188  (define (javni-& porsi mapti namapti)
    189     (define (mapti-& ignore-porsi nunvalsi)
    190       (mapti porsi nunvalsi))
     189    (define (mapti-& ignore-porsi ignore-nunvalsi)
     190      (mapti porsi (lambda () (make-javni-valsi #f ""))))
    191191
    192192    (define (namapti-& ignore-porsi)
     
    199199;; not-predicate: require that javni is not able to be parsed from
    200200;;                the |lerfu-porsi|.
    201 ;;
    202 ;; XXX: don't generate a nunvalsi.
    203201;;
    204202(define (nunjavni-! javni)
  • release/4/genturfahi/trunk/tests/and-predicate.scm

    r21571 r21576  
    3535(define (and-predicate-test genturfahi-and-predicate)
    3636  ; the and-predicate matches as normal, but does not advance
    37   ; the input.
     37  ; the input or return the parse result.
    3838  ;
    39   (test '(#\a "a") (genturfahi-and-predicate "a"))
     39  (test '("" "a") (genturfahi-and-predicate "a"))
    4040
    4141  ; It behaves like all other rules when there is no match,
     
    5757  ; only one.
    5858  ;
    59   (test '(#\a "aa") (genturfahi-and-predicate "aa"))
    60   (test '(#\a "ab") (genturfahi-and-predicate "ab"))
    61   (test '(#\a "ac") (genturfahi-and-predicate "ac"))
     59  (test '("" "aa") (genturfahi-and-predicate "aa"))
     60  (test '("" "ab") (genturfahi-and-predicate "ab"))
     61  (test '("" "ac") (genturfahi-and-predicate "ac"))
    6262
    6363  ; later characters that would match
Note: See TracChangeset for help on using the changeset viewer.