-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong column and line numbers in error message. #163
Comments
You can define your section rule similar to this (untested):
|
thanks @otac0n for your answer, but I think that it doesn't work. I tested it with the pegjs online tool. this is the screenshot. |
Bummer. Well, then this should probably be a bug. The original PEG paper indicated that errors should be defined inline. PEG.js does a good job of adding default error messages, but we should allow exceptions to indicate error positions as well. |
@otac0n hello, is there going to be a fix on this soon? |
It appears that you can do |
ah, so this is the recommended solution. |
I am closing this issue because the behavior of PEG.js is technically correct (as suggested in the original report already). @jairodemorais @vybs As for improving the error handling, please see #198. I welcome your input into the discussion. |
Hi @dmajda ,
we are using pegjs in Linkedin dustjs project, it is a really nice tool to generate parsers but now I am having a little issue with the error message.
Maybe I have written the pegjs rule wrong.
Let me try to explain my problem.
In the following example I would expect that the parser says that the error is in line 4, column 4 but it say line 1, column1.
I understand why pegs say that, the first tag is not a valid tag because it has a tag with an invalid tag inside.
But it is not intuitive for the users who writes our templates, because they think that the error is in line one but that is not correct, the error is in line 4.
this is the example:
Thanks, JAiro
The text was updated successfully, but these errors were encountered: