diff options
-rw-r--r-- | parser-combinators.scm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/parser-combinators.scm b/parser-combinators.scm index a92cd72..4a3a3f8 100644 --- a/parser-combinators.scm +++ b/parser-combinators.scm @@ -113,13 +113,6 @@ (loop rest)) (result result))))))) -;; This is a special form due to the lazy evaluation used to handle -;; right recursive grammars. -(define-syntax-rule (parse-any parser ...) - "Create a disjunctive parser that succeeds if any of the input -parsers succeed." - (%parse-any (delay parser) ...)) - (define (%parse-each . parsers) (lambda (stream) (let loop ((stream stream) @@ -133,6 +126,13 @@ parsers succeed." (($ <parse-result> value stream) (loop stream rest (cons value result))))))))) +;; parse-any and parse-seach are special forms to abstract the lazy +;; evaluation used to handle right recursive grammars. +(define-syntax-rule (parse-any parser ...) + "Create a disjunctive parser that succeeds if any of the input +parsers succeed." + (%parse-any (delay parser) ...)) + (define-syntax-rule (parse-each parser ...) (%parse-each (delay parser) ...)) |