Changeset 15779 in project for release/4/lexgen/trunk/lexgen.scm


Ignore:
Timestamp:
09/08/09 02:38:00 (10 years ago)
Author:
Ivan Raikov
Message:

lexgen: the seq combinator must check if the first parser in the
sequence has failed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/lexgen/trunk/lexgen.scm

    r14956 r15779  
    9191(define (seq p1 p2)
    9292  (lambda (cont streams)
    93     (p1 (lambda (streams1) (p2 cont streams1)) streams)))
    94 
     93    (p1 (lambda (streams1)
     94          (if (null? streams1)
     95              (cont streams1) (p2 cont streams1)))
     96        streams)))
    9597
    9698;; This matches either one of two patterns. It's analogous to patterns
Note: See TracChangeset for help on using the changeset viewer.