-
Notifications
You must be signed in to change notification settings - Fork 86
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
Update c #213
Update c #213
Conversation
ac7f325
to
e7270fc
Compare
…logic to fail if the version bump is incorrect
Why did the parser grow significantly with this version bump? @amaanq please tag me for reviews before merging anything here |
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.
There are a lot of changes here I'm not sure should have been made. Please see my comments, and include me as a reviewer on future changes to this repo, thanks.
$.try_statement, | ||
$.throw_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.
None of these are top level statements in c++
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 is identical to _non_case_statement
. I wonder, did you tweak the c grammar to add essentially the exact same thing I added this for awhile back?
What is _top_level_statement specifically describing in the c grammar?
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.
Hmm you're right, they are the same. I changed expression_statement for top_level_statements because binary expressions caused issues with a declaration like so:
TSLanguage *(*lang_parser)(void();
I just assumed top_level_statement was more or less the same as non_case_statement, seeing that there were coroutine statements in top level statements in tests
Should I remove try and throw then?
alias($.constructor_or_destructor_definition, $.function_definition), | ||
alias($.operator_cast_definition, $.function_definition), | ||
alias($.operator_cast_declaration, $.declaration), | ||
), |
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.
What is this for?
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.
reworked top level items in C, this just adds certain bits missing to _block_item that _top_level_item had
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.
Is it possible to consolidate all these various lists of "top level-like items? It seems like there's quite a bit of copy/paste and is likely one of the reasons for the pretty large increase in state count and parser size this commit introduced.
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.
Not exactly, because top level items and block items use different versions of expression statements to keep top level declarations less conflicting with binary expressions.
tree-sitter/tree-sitter-c#146
Sure, I just didn't want downstream too impacted by changing C quite a bit without having C++ adapted. |
No description provided.