-
Notifications
You must be signed in to change notification settings - Fork 115
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
incorrect parse for destructuring dssignment #318
Comments
I might be misreading the grammar, but it looks to me like (This is made more confusing because |
Oh... I thought that So an |
I suspect that fidelity with the ECMAScript grammar is a non-goal for tree-sitter-javascript. |
I see... and I think that's fine; nevertheless it might be interesting to avoid non-terminal names that are the same as those in ECMAScript yet with a different meaning. Would do you say? |
That would reduce the likelihood of misunderstandings among people who are looking at both grammars. So it would have been a good idea to adopt at the start, but might be too disruptive to adopt now. (The project may make backward-compatibility guarantees re nonterminal names, I don't know.) |
it's okay to be disruptive - we're still pre 1.0 overall, and breaking changes aren't something we're against (though typically it should be for a good reason, and imo, achieving fidelity with the ECMAScript grammar is a good reason) If you want to tackle this @ltcmelo, feel free to, else I can when I get time |
Thanks for the feedback @amaanq, and sorry for the late response. I can't make a compromise to tackle this at the moment, unfortunately. |
I suspect that the assignment_expression in following piece of code is parsed incorrectly:
Here's the output that I get for it:
If my suspicion is correct, then the pattern underneath the assignment should be an
object_assignment_pattern
rather than anobject_pattern
. What do you think?Note: Related to this, I think that the "circumstances" in which the grammar of an AssignmentPattern (including an ObjectAssignmentPattern) applies isn't clear enough in the ECMA spec, so I create this issue there.
The text was updated successfully, but these errors were encountered: