summaryrefslogtreecommitdiffstats
path: root/src/test/ui/proc-macro/nested-nonterminal-tokens.rs
blob: 04d34e21cdc74b1bc78999de1f015c50e7bb3988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 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) => {
        print_bang!($e + 3)
    };
}

fn main() {
    let _ = wrap!(first, 0);
}