Skip to content

Naive support for iterative parsing in packrat

Sven M. Hallberg requested to merge pesco/hammer:packrat-iterative into master

The naive implementation concatenates all input and blindly re-runs the full parse on every chunk. Keeping state between chunks is for later.

Note: The iterative API expects us to always consume an entire input chunk when we suspend, even if packrat later backtracks into it. We will produce the correct parse result and accurately consume from a final chunk, but all earlier chunks will be reported as fully consumed and as being part of the HParseResult in terms of its bit_length field.

Includes a deactivated test case for a dummy implementation that supports the chunked API, but fails if more than one chunk is actually needed. Might be useful again in the future.

Also includes some purely cosmetic improvements.

Merge request reports