From 04c27f3a7201d2a91463253053ed432e9be856b3 Mon Sep 17 00:00:00 2001 From: Kathy Gray Date: Thu, 10 Apr 2008 11:32:57 +0000 Subject: [PATCH] Bug fix svn: r9237 --- .../private-combinator/combinator.scm | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/collects/combinator-parser/private-combinator/combinator.scm b/collects/combinator-parser/private-combinator/combinator.scm index f761fafb06..b937c25e6e 100644 --- a/collects/combinator-parser/private-combinator/combinator.scm +++ b/collects/combinator-parser/private-combinator/combinator.scm @@ -197,6 +197,27 @@ (map (lambda (rst) (next-res old-answer new-id old-used tok rst)) (lazy-opts-matches rsts)) (make-options-fail 0 #f #f 0 0 null) null)] + [(and (lazy-opts? rsts) (not (lazy-choice? rsts))) + (make-lazy-opts + (map (lambda (rst) (next-res old-answer new-id old-used tok rst)) + (lazy-opts-matches rsts)) + (lazy-opts-errors rsts) + (map (lambda (thunk) + (lambda () + (let ([ans (next-opt rsts)]) + (and ans (next-res old-answer new-id old-used tok ans))))) + (lazy-opts-thunks rsts)))] + [(lazy-choice? rsts) + (make-lazy-choice + (map (lambda (rst) (next-res old-answer new-id old-used tok rst)) + (lazy-opts-matches rsts)) + (lazy-opts-errors rsts) + (map (lambda (thunk) + (lambda () + (let ([ans (next-choice rsts)]) + (and ans (next-res old-answer new-id old-used tok ans))))) + (lazy-opts-thunks rsts)) + (lazy-choice-name rsts))] [(pair? rsts) (map (lambda (rst) (next-res old-answer new-id old-used tok rst)) (flatten (correct-list rsts)))]