diff options
Diffstat (limited to 'syntax-highlight/parsers.scm')
-rw-r--r-- | syntax-highlight/parsers.scm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/syntax-highlight/parsers.scm b/syntax-highlight/parsers.scm index 5d08e45..41975d6 100644 --- a/syntax-highlight/parsers.scm +++ b/syntax-highlight/parsers.scm @@ -89,20 +89,20 @@ PREDICATE is satisfied with the result." "Create a parser that tries to parse with FIRST or, if that fails, parses SECOND." (lambda (stream) - (let-values (((result stream) (first stream))) + (let-values (((result remaining) (first stream))) (if result - (values result stream) + (values result remaining) (second stream))))) (define (parse-both first second) "Create a parser that returns a pair of the results of the parsers FIRST and SECOND if both are successful." (lambda (stream) - (let-values (((result1 stream) (first stream))) + (let-values (((result1 remaining) (first stream))) (if result1 - (let-values (((result2 stream) (second stream))) + (let-values (((result2 remaining) (second remaining))) (if result2 - (values (cons result1 result2) stream) + (values (cons result1 result2) remaining) (parse-fail stream))) (parse-fail stream))))) |