Help on declarative macro

Help on declarative macro.
I want a macro that takes other macros as input and inside the main macro, expands the other macros and grab their input and use their inputs.
How do I do that
e.g

macro_rules! example {
    (???) => {
        ???
        // use the expanded information and pass it on
    }
}

It is not possible for a declarative macro to see the output of another macro.

Even if you could, you usually shouldn’t, because the exact expansion of a macro is often an implementation detail subject to change.

I just clarifying so this is not possible

macro_rules! custom {
    (???) => {
        ???
        custom!(???);
        // The ??? Is I don’t know what to put, not literal tokens input
    }
    ($lit:literal) => {
         // Do whatever
    }
}
fn main() {
    custom!(format!(“{}”, “aa”));
    custom!(some_another_macro!());
}

You could match the tokens of the format!() macro call itself, but you can't expand it.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.