PEG.jl icon indicating copy to clipboard operation
PEG.jl copied to clipboard

File locations in production rules

Open BenChung opened this issue 8 months ago • 1 comments

In a production function (e.g. the rhs of > or |>) is it possible to get the location in the file that's currently being parsed? It would be very useful to be able to extract ideally byte ranges, or at least a character-line position a la the error message for use in downstream error messages. I tried to figure out how to get this information out of the same logic that's used to generate the error messages but it doesn't seem to be present in the production rule logic?

BenChung avatar Apr 26 '25 06:04 BenChung