-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Implement Token! macro for syntax kinds, a-la syn #1248
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
Comments
Though, I am not sure if macros are allowed in patterns. If they aren't, then probably we should stick with the current approach. |
Macro is allowed in pattern :) See #1220 |
I have never created rust macro. I think it is a good day to start. |
Hi. I've made PR with T! macro apply for whole project. I hope it will be helpful. |
Can this be closed? |
Syn has a lovely
Token!
macro for defining tokens without naming them:Token![,]
:https://docs.rs/syn/0.15.33/syn/macro.Token.html
We should add a similar macro for our SyntaxKind, to make code like this more readable:
https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide_api/src/extend_selection.rs#L137-L138
The text was updated successfully, but these errors were encountered: