Changeset 14816 in project


Ignore:
Timestamp:
05/28/09 04:49:52 (10 years ago)
Author:
Ivan Raikov
Message:

what should be a final fix for abnf#drop

File:
1 edited

Legend:

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

    r14815 r14816  
    201201(define (drop p)
    202202  (lambda (ss)
    203     (let ((ss1 (map (lambda (s)
    204                       (match s ((eaten food)  (list (list (make-box eaten)) food))
    205                              (else s)))
    206                     ss)))
    207       (match (lex:longest (p ss1))
    208              ((eaten food) (let ((eaten1 (unbox (last eaten))))
    209                              (list (list eaten1 food))))
    210              (else #f)))))
     203    (if (null? ss) ss
     204        (begin
     205          (let ((ss1 (map (lambda (s)
     206                            (match s ((eaten food)  (list (list (make-box eaten)) food))
     207                                   (else s)))
     208                          ss)))
     209            (match (lex:longest (p ss1))
     210                   ((eaten food) (let ((eaten1 (unbox (last eaten))))
     211                                   (list (list eaten1 food))))
     212                   (else #f)))))))
    211213
    212214(define (collect-chars . rest)
Note: See TracChangeset for help on using the changeset viewer.