-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
Easier punctuation and keyword parsing #225
Comments
As part of this, let's also explore what it would look like to use type macros for token types, rather than giving them names like ItemExternCrate {
pub attrs: Vec<Attribute>,
pub vis: Visibility,
pub extern_token: Token![extern],
pub crate_token: Token![crate],
pub ident: Ident,
pub rename: Option<(Token![as], Ident)>,
pub semi_token: Token![;],
} |
Once the user is no longer typing the token names, will probably want to rename the various token structs to prefix the name, like ShlEq -> TokenShlEq like we do for items and exprs. This will avoid conflicts with prelude types like Default and syn types like Type (after we rename Ty -> Type). |
Implemented in #241. |
Currently parsing punctuation looks like
syn!(ShlEq)
and parsing a keyword looks likesyn!(Default_)
. I would much rather writepunct!(<<=)
andkeyword!(default)
instead -- and have that produce the correct struct type without me having to look up its name.The text was updated successfully, but these errors were encountered: