Attribute Macro macro_magic_macros::with_custom_parsing
source · #[with_custom_parsing]
Expand description
To be used in tandem with #[import_tokens_attr]
Example:
ⓘ
#[import_tokens_attr]
#[with_custom_parsing(MyCustomParsing)]
#[proc_macro_attribute]
pub fn my_attribute(attr: TokenStream, tokens: TokenStream) -> TokenStream {
let external_item = parse_macro_input!(attr as Item);
let attached_item = parse_macro_input!(tokens as Item);
let custom_parsed_item = parse_macro_input!(__custom_tokens as MyCustomParsing);
// ...
}