Repository navigation
Replies: 1 comment 2 replies
|
I like this idea a lot. The relatively-new If we're going to do something more with GrammarLocation, we'll also need to pass in a length, since your input is likely to be a substring of a larger block of text. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sometimes it is useful to parse a set of data in multiple passes, the first splitting the data and subsequent parses parsing each section of data from the first parse.
We are doing exactly that in our project.
When doing so, it is currently very difficult to keep track of the source locations, because the sub-parse has its source location start from 0 again. All offsets must be muddled in using pretty hacky code.
It would be absolutely great to be able to simple pass in as an option:
Where the
locationOffsetis then added to the location returned by thelocation()function (column only applying to the first line).I'm happy to create a PR for this.
All reactions