sql-parser
sql-parser copied to clipboard
add node location / position
wondering if you can add node position, and or if there is any reason for not to have it. similar to this https://github.com/redotjs/redot/blob/b5abff784e9952d12d3713f27839bed12ee173df/packages/redot-parse/dot.pegjs#L13 thanks!
I think pegjs does this automatically (see documentation)
The code inside an action can also invoke the error function, which also makes the parser throw an exception. The function takes two parameters — an error message and optional location information (the default is what location would return — see below). The message will be used by the thrown exception.
What are the advantages of adding the location function manually to each rule?