-
Notifications
You must be signed in to change notification settings - Fork 5
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
Consistent binding forms #33
Comments
The grammar doesn’t support command bindings without a space after the first word, such as:
See #21 |
As mentioned elsewhere, implementing this as an ambiguous grammar with higher priorities for the special binding forms results in strange error correcting behaviour. I believe this is because tree-sitter doesn’t backtrack, and therefore it commits to, e.g., a key binding form whenever it sees something starting with the word “key”, and then error corrects to something strange if we really dealing with a command declaration, e.g., |
The best solution is probably to implement this using lookahead in the parser, i.e., if we see the name of a special binding form at the start of the line, and it has a well formed argument list followed by a colon, we emit the name wrapped in a Implementing this in the lexer requires modifying |
The grammar for special binding forms currently results in inconsistent parse trees and include the opening parentheses in the name. This leads to several usability issues:
face
,gamepad
, etc #31This issue tracks those problems, as they share a common cause and solution.
The text was updated successfully, but these errors were encountered: