-
-
Notifications
You must be signed in to change notification settings - Fork 130
Support assignment for non_null_assertion in the LHS #119
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
Support assignment for non_null_assertion in the LHS #119
Conversation
Thanks for the fix! I left a question about tree-sitter/tree-sitter-javascript#146. Let's resolve that before merging this one. |
fd7ec0e
to
e68a521
Compare
* designate special group for LHS of augmented assignment expression needed for tree-sitter/tree-sitter-typescript#119 * regenerate parser for '_augmented_assignment_lhs' Co-authored-by: resolritter <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good; I just left one grammar style suggestion.
common/define-grammar.js
Outdated
)), | ||
|
||
_augmented_assignment_lhs: ($, previous) => choice(...previous.members.concat([$.non_null_expression])), | ||
_lhs_expression: ($, previous) => choice(...previous.members.concat([$.non_null_expression])), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both of these could be written choice(previous, $.non_null_expression)
. The nesting of choices doesn't matter, so there's no need to 'flatten' it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion taken
e68a521
to
e33f458
Compare
Thanks! |
closes #107
Code changes are ready. The PR is currently marked as "Draft" because it requires changes in tree-sitter-javascript (tree-sitter/tree-sitter-javascript#146).