-
Notifications
You must be signed in to change notification settings - Fork 45
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
ParserError is missing end position #156
Comments
@KFlash this is probably going to be a breaking change. |
What other parsers do ? |
I see your point. It seems babel/parser also has the
@tscpp what was your previous parser? |
@3cp I will ask him. I know his language @tscpp Kan du utarbeta lite mer om vad du menar? Alla "parsers" gör samma sak. Och i Meriyah är detta baserat på ECMA-standarden. Vad är skillnaden mellan Meriyah och den tidigare koden du använde? Kan det räcka att lägga till en extra "property"? Kommer det att hjälpa dig? |
The projected used Acorn before. I switched to Meriyah because of the performance difference and the support for ES2020. We didn't log the syntax error location before. We logged the error to the whole line. I got suggested to log the syntax error meanwhile I was working with the pull request. We want support for end positions, but it was not available, so I created this issue. If this is possible, my suggestion would be to add a property called Adding the property |
@3cp It shouldn't be too hard to add extra property? See this code. Loc already exist. Shouldn't affect the rest of the AST nodes. @tscpp Sounds okay? I'm not sure what language you prefer? Är detta en okej lösning på problemet? För att lägga till det här? |
Jag föredrar engelska så att andra kan läsa mina kommentarer 😁 I'm making a pull request adding the property |
Should |
I don't think it's an standard on this. All Parsers report this differently. Try to look what others do with AST explorer |
Which properties in |
See |
Acorn uses SyntaxError which doesn't report the start position. |
Because the variable node is not defined in every function in |
cc @3cp Could you help out with this? |
It's hard to follow without looking at the code. You can make a draft PR, doesn't need to be fully functional, but provide a base for us to discuss. |
I need the end position of any parser error for my linter, but this is not an available property in the ParserError class.
The text was updated successfully, but these errors were encountered: