-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add in support for boolean, character, and symbol literals. #22
Conversation
4b5dea8
to
361cff2
Compare
Just realized I also need to support symbol literals as well, plus there is an issue here with character literals. I'll add symbol literals to this as well before marking it ready to review. |
Previously we would just handle boolean literals and character literals as identifiers, and wouldn't handle symbol literals.
361cff2
to
b4b6825
Compare
character_literal: $ => token(seq( | ||
'\'', | ||
optional(choice( | ||
seq('\\', choice( | ||
/[^xu]/, | ||
/u[0-9a-fA-F]{4}/, | ||
/u{[0-9a-fA-F]+}/, | ||
/x[0-9a-fA-F]{2}/ | ||
)), | ||
/[^\\'\n]/ | ||
)), | ||
'\'' | ||
)), |
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.
I went back and forth on this a bunch trying to exactly get what is described here, and finally I just went with a modified version of what tree-sitter-rust was using.
Thanks! Sorry for the delay. |
Previously we would just handle boolean literals and character literals
as identifiers, and wouldn't handle symbol literals.