Changeset 14877 in project


Ignore:
Timestamp:
06/03/09 13:53:57 (10 years ago)
Author:
Ivan Raikov
Message:

abnf drop-consumed rewritten in cps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/abnf/abnf.scm

    r14876 r14877  
    215215(define (drop-consumed p)
    216216  (lambda (a r ss)
    217     (if (null? ss) (a ss)
    218         (let ((ss1 (map (lambda (s)
    219                           (match s ((eaten food)  (list (list (make-box eaten)) food))
    220                                  (else s)))
    221                         ss)))
    222           (match (lex:longest (p a r ss1))
    223                  ((eaten food) (let ((eaten1 (unbox (last eaten))))
    224                                  (a (list (list eaten1 food)))))
    225                  (else (r ss1)))))))
     217    (let ((ss1 (map (lambda (s)
     218                      (match s ((eaten food)  (list (list (make-box eaten)) food))
     219                             (else s)))
     220                    ss))
     221          (a1  (lambda (ss)
     222                 (let ((ss1 (lex:longest ss)))
     223                   (match ss1
     224                          ((eaten food) (let ((eaten1 (unbox (last eaten))))
     225                                          (a (list (list eaten1 food)))))
     226                          (else (r ss)))))))
     227      (p a1 r ss1))))
    226228
    227229(define (collect-chars . rest)
Note: See TracChangeset for help on using the changeset viewer.