Skip to content
Snippets Groups Projects
Commit 866fd4d6 authored by Sven M. Hallberg's avatar Sven M. Hallberg
Browse files

fail packrat parsers if they need more input

This commit changes the contract for the combinator parse functions:

 (1) The input state on failure must retain valid overrun and last_chunk
     fields. The latter is never changed, but overrun would be cleared by
     various combinators that backtrack in case of failure. All other
     fields of the input stream are still considered indeterminate after a
     failed parse.

 (2) If an overrun condition is encountered before the final chunk
     (last_chunk is false), the parse *must* fail. A helper want_suspend()
     is introduced as a shorthand for this check.

Fixes the packrat/iterative/dummy test.
parent 0d7f1091
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment