PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/src/test/run-pass/macro.rs

http://github.com/jruderman/rust
Rust | 11 lines | 8 code | 2 blank | 1 comment | 2 complexity | 0eb0e79943b2de839559d912ce71c726 MD5 | raw file
 1// xfail-pretty - token trees can't pretty print
 2
 3fn main() {
 4    #macro[[#m1[a], a * 4]];
 5    assert (m1!{2} == 8);
 6
 7    macro_rules! m1tt {
 8        {$a:expr} => {$a*4}
 9    };
10    assert(m1tt!{2} == 8);
11}