Skip to content
Snippets Groups Projects
Forked from Hammer / hammer
Source project has a limited visibility.
  • Sven M. Hallberg's avatar
    fail packrat parsers if they need more input · 866fd4d6
    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.
    866fd4d6
    History