dtolnay/cargo-expand

Can cargo-expand only expand procedural-macro, not including declarative macros?

StevenJiang1110 opened this issue · 1 comments

I want to define and export declarative macros inside procedural-macro. For debug use, I want to see the exact declarative macros. Below is a simple example.

#[proc_macro]
pub fn example_macro(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
    quote!(
        #[macro_export]
        macro_rules! print_hello {
            () => (
                println!("hello world");
            )
        }
    ).into()
}

I only want to expand example_macro, but not print_hello inside, is this possible? Thanks a lot.