diff options
| author | John Clements <clements@racket-lang.org> | 2013-07-11 22:58:14 -0700 |
|---|---|---|
| committer | John Clements <clements@racket-lang.org> | 2013-09-06 13:35:12 -0700 |
| commit | 60562ac9f8c68c1cf3b30efcd6d6954a9b82acbe (patch) | |
| tree | e9ee19f59738dd6ada11f5ebe50218984a51abd7 /src/libsyntax/ext | |
| parent | ec0a64def54e0b381ede187bfe199b7620b56c45 (diff) | |
| download | rust-60562ac9f8c68c1cf3b30efcd6d6954a9b82acbe.tar.gz rust-60562ac9f8c68c1cf3b30efcd6d6954a9b82acbe.zip | |
whitespace, reindentation, and comments only
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 40 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 1 |
2 files changed, 22 insertions, 19 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index dfeb938c709..8ee045ba8c1 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -76,19 +76,20 @@ pub fn expand_expr(extsbox: @mut SyntaxEnv, // mark before: let marked_before = mark_tts(*tts,fm); let marked_ctxt = new_mark(fm, ctxt); - let expanded = match expandfun(cx, mac.span, marked_before, marked_ctxt) { - MRExpr(e) => e, - MRAny(expr_maker,_,_) => expr_maker(), - _ => { - cx.span_fatal( - pth.span, - fmt!( - "non-expr macro in expr pos: %s", - extnamestr + let expanded = + match expandfun(cx, mac.span, marked_before, marked_ctxt) { + MRExpr(e) => e, + MRAny(expr_maker,_,_) => expr_maker(), + _ => { + cx.span_fatal( + pth.span, + fmt!( + "non-expr macro in expr pos: %s", + extnamestr + ) ) - ) - } - }; + } + }; // mark after: let marked_after = mark_expr(expanded,fm); @@ -1735,12 +1736,14 @@ mod test { ~[~[0]]) // FIXME #6994: the next string exposes the bug referred to in issue 6994, so I'm // commenting it out. - // the z flows into and out of two macros (g & f) along one path, and one (just g) along the - // other, so the result of the whole thing should be "let z_123 = 3; z_123" - //"macro_rules! g (($x:ident) => ({macro_rules! f(($y:ident)=>({let $y=3;$x}));f!($x)})) + // the z flows into and out of two macros (g & f) along one path, and one + // (just g) along the other, so the result of the whole thing should + // be "let z_123 = 3; z_123" + //"macro_rules! g (($x:ident) => + // ({macro_rules! f(($y:ident)=>({let $y=3;$x}));f!($x)})) // fn a(){g!(z)}" - // create a really evil test case where a $x appears inside a binding of $x but *shouldnt* - // bind because it was inserted by a different macro.... + // create a really evil test case where a $x appears inside a binding of $x + // but *shouldnt* bind because it was inserted by a different macro.... ]; for s in tests.iter() { run_renaming_test(s); @@ -1820,7 +1823,8 @@ mod test { // find the ext_cx binding let bindings = @mut ~[]; visit::walk_crate(&mut new_name_finder(bindings), crate, ()); - let cxbinds : ~[&ast::Ident] = bindings.iter().filter(|b|{@"ext_cx" == (ident_to_str(*b))}).collect(); + let cxbinds : ~[&ast::Ident] = + bindings.iter().filter(|b|{@"ext_cx" == (ident_to_str(*b))}).collect(); let cxbind = match cxbinds { [b] => b, _ => fail!("expected just one binding for ext_cx") diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 074ec3cd195..4b0974b70bf 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -49,7 +49,6 @@ pub fn add_new_extension(cx: @ExtCtxt, // ...quasiquoting this would be nice. let argument_gram = ~[ ms(match_seq(~[ - // NOTE : probably just use an enum for the NT_name ? ms(match_nonterminal(lhs_nm, special_idents::matchers, 0u)), ms(match_tok(FAT_ARROW)), ms(match_nonterminal(rhs_nm, special_idents::tt, 1u)), |
