dtolnay / quote

Rust quasi-quoting
Apache License 2.0
1.32k stars 90 forks source link

Recursively respan tokens interpolated from a macro_rules metavariable #199

Closed dtolnay closed 2 years ago

dtolnay commented 2 years ago

Repro:

macro_rules! repro {
    ($span:expr=> $expr:expr) => {
        quote_spanned!($span=> $expr)
    };
}

Previously an invocation like repro!(span=> a + (b)) would set the specified span on the top-level tokens only, i.e. a and + and the paren token, but not on the b token.