-
-
Notifications
You must be signed in to change notification settings - Fork 137
Designate "else"/"else if" branches inside of if statements #143
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
Conversation
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.
👍 Your explanation in #142 makes sense, and I like this change.
I think the CI failure is because you generated the parser with tree-sitter
0.17.x, but the package.json
file still has tree-sitter-cli 0.16.x
in the dependencies
. I think it would be ok to go ahead and upgrade tree-sitter-cli
to the latest version as part of this PR. You just need to change the version number in dependencies
to 0.17.3
.
grammar.js
Outdated
@@ -239,14 +239,13 @@ module.exports = grammar({ | |||
optional($._automatic_semicolon) | |||
)), | |||
|
|||
else_branch: $ => seq('else', $._statement), |
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.
Could you change this name to else_clause
? I think that for these parts of statements, we usually use the term "clause" in this and other tree-sitter grammars. See for example catch_clause
, finally_clause
in this file.
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.
changed to else_clause
upgrade done in 353c6fe#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519, we'll see if CI passes... |
* designate "else_clause" inside of if statements * upgrade tree-sitter-cli tree-sitter/tree-sitter-javascript#143 (review) * regenerate files for else_clause Co-authored-by: resolritter <[email protected]>
ping @maxbrunsfeld I've made the requested changes. I can open another PR at tree-sitter-typescript for regenerating the parser after this lands. |
Thanks! |
closes #142
code changes are included isolatedly in the first commit