Is it possible to parse #[my_attribute("literal")]
?
#240
-
How can I create derive macro use derive::Rule;
#[derive(Rule)]
#[rule("{username}:{password}")]
struct Credentials {
#[pattern("/[_0-9a-zA-Z]+/")]
pub username: String,
#[pattern("/[_0-9a-zA-Z]+/")]
pub password: String
} |
Beta Was this translation helpful? Give feedback.
Answered by
TedDriggs
Jun 12, 2023
Replies: 1 comment
-
You’ll want to follow the examples around attribute macros that aren’t derive macros, and probably use the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
TedDriggs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You’ll want to follow the examples around attribute macros that aren’t derive macros, and probably use the
forward_attrs
option to collect those for subsequent processing.