Repository navigation
Fixes - #217
Fixes#217
Conversation
|
I'll take a look at this at some point tomorrow. Thanks for working on this! |
| [$._binary_fold_operator, $._fold_operator], | ||
| [$.expression_statement, $.for_statement], | ||
| [$.init_statement, $.for_statement], | ||
| [$._function_declarator_seq], |
There was a problem hiding this comment.
What was the new conflict here?
There was a problem hiding this comment.
repeat($.attribute_specifier) after noexcepts
| $.using_declaration, | ||
| $.type_definition, | ||
| $.static_assert_declaration, | ||
| ';', |
There was a problem hiding this comment.
Semicolons can technically appear anywhere a statement is valid. I think you were trying to close a particular issue regarding having an extraneous semicolon (#35?), but I think we should hold off and try to figure out a way to make "empty" statements (a single semicolon) work anywhere a statement could appear (any of which would end with a semicolon), instead of only as a field declaration.
Not sure how terrible that would be for node count though :)
There was a problem hiding this comment.
Hm, maybe something like javascript's automatic semicolons could be used, only adds 7 to state count though
There was a problem hiding this comment.
Not familiar with that, but I think we should make something like an empty_statement: $ => ';' rule and just put that as an option in various places where other statements (including top level) can be. Not the most elegant and I haven't actually tried this so it may not really work in practice but something like that is the best way to make the grammar not choke on extra semicolons.
There was a problem hiding this comment.
https://github.com/tree-sitter/tree-sitter-javascript/blob/master/src/scanner.c, though C++ is a bit different and an empty_statement node would be just fine as well - but I think naming it _empty_statement to hide the rule could be better
jdrouhard
left a comment
There was a problem hiding this comment.
Don't forget to update the list of issues this will close since we're punting a couple for another PR.
Looks good
|
Hi @amaanq, I am asking this just in case I miss it, are you working on the fix for the precedence issue of parenthesized assignment expressions? |
|
Thanks for the reminder, it slipped my mind completely. I've come up with a solution now but I'd appreciate more testing for potential pitfalls. |
It's great to hear you've got a solution, looking forward to seeing the PR soon. |
Some bug fixes
Did this to prep for another release, and most of these were easy enough to fix and aren't anything complicated.
The main change that really increased state count a bit is backporting the C updates where I added attribute_specifier to more allowed locations.
Closes #47
Closes #63 (really a C bug fixed in 0.20.4)
Closes #96
Closes #102
Closes #103
Closes #112
Closes #139
Closes #203
The last issue that's a bit difficult is the parenthesized assignment expressions, that's because of fold operators taking precedence over them but I could not figure that out, I'll try a bit more anyways