-
Notifications
You must be signed in to change notification settings - Fork 59
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
refactor: programs as delimited sequences of statements #164
Conversation
we've lost parsing of string function bodies but that was probably a bad idea to begin with.
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.
Wow, I am really surprised hat these few change have such a big impact. I am really impressed! Thanks @dmfay
@@ -489,13 +492,48 @@ module.exports = grammar({ | |||
// https://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment | |||
marginalia: _ => seq('/*', /[^*]*\*+(?:[^/*][^*]*\*+)*/, '/' ), | |||
|
|||
compound_statement: $ => seq( |
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.
In nvim-treesitter there is a indentens.scm
, which refenrences compound_Statement
. We should have added a copy of this to our repo as well, so that the tests fail here when we rename nodes.
what statements are you referring to? Can you give me an example? |
there are a couple in the tests, for example
|
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.
Wow this is great, the decrease in number of states is huge 🎉🎉🎉
eliminates the recently added conflicts, shaves a few seconds off compile time, and state count in the parser is cut by over half -- from 7151 states to 3087!
Other changes:
compound_statement
has been renamed toblock
create_function
usesobject_reference
correctly