-
Notifications
You must be signed in to change notification settings - Fork 234
Open
Description
The following grammar produces a Syntax Error with line
2 and col
12:
@{%
%}
test[a] -> ]
Since offset
is 18
, nearley is able to display the correct location of the error when formatting, but I think it would be nice to reflect the original file line and column also.
For example, this PR with moo
to provide contextual errors makes use of line
and col
over offset
, so would point to the wrong location in this example.
A workaround can be for the grammar author to move additional JS blocks towards the bottom of the grammar file, therefore not changing the line locations of the grammar above.
I imagine a straightforward fix could be to "blank" out the locations where additional JS is present in any intermediate grammar, ie. intermediate result looking like:
test[a] -> ]
Metadata
Metadata
Assignees
Labels
No labels