-
Notifications
You must be signed in to change notification settings - Fork 18
Move inline decorator to scanner #218
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
Absolutely great! Thank you. I like that many conflicts are gone now. Would you rebase the branch, please? |
Done |
Ops, a small error introduced. '@'
In main branch it's is parsed. Edit 1: The parser look at
|
|
grammar.js
Outdated
@@ -1485,7 +1452,7 @@ module.exports = grammar({ | |||
|
|||
character: $ => seq( | |||
"'", | |||
repeat(choice(/[^\\']/, $.escape_sequence)), | |||
repeat(choice(/[^\\']/, $.escape_sequence, '@')), |
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 a workaround to parse don't look at '@' an expect an decorator inline.
55d6b56
to
e2af3e7
Compare
The last commit e2af3e7 removed the workaround and fixed the error with characher |
Now the scanner will parse the start of the decorator: |
Brilliant! Thank you! |
Move inline decorator to scanner.
Inline decorator is decorator without arguments.
Decorators with arguments can be specified in
grammar.js
. This was a limitation because TreeSitter could not determine the end of the rule.Decorators can now be treated as a comment, can appear anywhere.
This PR also removes some conflicts that were introduced due to decorators. We can also remove some tests with decorators.