-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Support paste in arbitrary name-value attributes #57
Conversation
Ping @dtolnay, I would like to know whether you like the idea, or if you think this is inappropriate for |
I am on board with this. The PR is marked experimental. Are you planning changes or is this ready for review? |
I’ve tested it on my side and it covers my use case, so ready for review. Cc @frol. |
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.
It looks like this turns all values in key/value attributes into strings, which is likely to break some macros.
#[proc_macro_attribute]
pub fn debug(_args: TokenStream, input: TokenStream) -> TokenStream {
println!("{}", input);
TokenStream::new()
}
paste! {
#[debug]
#[xyz = 123]
struct S;
}
#[xyz = "123"] struct S ;
I restored the previous behavior which was to have at least two tokens after the |
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.
Thanks!
Fixes #56.