Forked from
Hammer / hammer
Up to date with the upstream repository.
-
Sven M. Hallberg authored
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.
optional.c 2.88 KiB