We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Token!
Something like:
pub struct Token<const A: char, const B: char = '\0', const C: char = '\0'>;
Then you'd use Token<'+'> for what used to be Token![+], and Token<'+', '='> instead of Token![+=], etc.
Token<'+'>
Token![+]
Token<'+', '='>
Token![+=]
The custom_punctuation! macro (https://docs.rs/syn/1.0.105/syn/macro.custom_punctuation.html) would no longer be necessary because you could instantiate a Token with any arbitrary punctuation without needing to give it a name.
custom_punctuation!
Token
The text was updated successfully, but these errors were encountered:
Another possibility: the approach from https://docs.rs/monostate/0.1.1/monostate/index.html.
Sorry, something went wrong.
See #1209. The use of type macros like Token! in a generic data structure prevents derive from being used.
derive
Tracking issue: rust-lang/rust#95174
No branches or pull requests
Something like:
Then you'd use
Token<'+'>
for what used to beToken![+]
, andToken<'+', '='>
instead ofToken![+=]
, etc.The
custom_punctuation!
macro (https://docs.rs/syn/1.0.105/syn/macro.custom_punctuation.html) would no longer be necessary because you could instantiate aToken
with any arbitrary punctuation without needing to give it a name.The text was updated successfully, but these errors were encountered: