2020-09-24 09:45:51 -05:00
|
|
|
// check-pass
|
|
|
|
// edition:2018
|
|
|
|
// compile-flags: -Z span-debug
|
|
|
|
// aux-build:test-macros.rs
|
|
|
|
|
|
|
|
// Tests that we properly pass tokens to proc-macro when nested
|
|
|
|
// nonterminals are involved.
|
|
|
|
|
|
|
|
#![no_std] // Don't load unnecessary hygiene information from std
|
|
|
|
extern crate std;
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate test_macros;
|
|
|
|
|
|
|
|
|
|
|
|
macro_rules! wrap {
|
|
|
|
(first, $e:expr) => { wrap!(second, $e + 1) };
|
|
|
|
(second, $e:expr) => { wrap!(third, $e + 2) };
|
|
|
|
(third, $e:expr) => {
|
2021-07-22 14:28:02 -05:00
|
|
|
print_bang!($e + 3)
|
2020-09-24 09:45:51 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = wrap!(first, 0);
|
|
|
|
}
|