streamly icon indicating copy to clipboard operation
streamly copied to clipboard

A parser that follows another parser and computes location information

Open harendra-kumar opened this issue 6 months ago • 0 comments

The problem to be solved is the parse error position reporting in a modular way. To do that we can use a separate parser which computes the current position from the stream. This position could be byte position, line number or any other way of indicating the position. The position parser would accept the input that has already been consumed and discarded by the main parser. Therefore, the parser driver just needs to feed it the input that is being discarded from the backtrack buffer. Anything that is still in the backtrack buffer does not need to be given to this parser as it can be accounted at the time of error.

See #591

harendra-kumar avatar Jun 29 '25 17:06 harendra-kumar