about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorEric Holk <eric.holk@gmail.com>2012-08-13 16:03:13 -0700
committerEric Holk <eric.holk@gmail.com>2012-08-13 16:20:23 -0700
commit4ec1dd991405404725b5cc448295dc0be9cd17e5 (patch)
tree21dad99d125c9cd021029b316658326578337a7f /src/libsyntax
parent8bb5f077c4feb6a2a180810fc16c092bf3532f76 (diff)
downloadrust-4ec1dd991405404725b5cc448295dc0be9cd17e5.tar.gz
rust-4ec1dd991405404725b5cc448295dc0be9cd17e5.zip
Got the select macro working.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index 4a7becf1919..8abe8d8309d 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -47,9 +47,16 @@ fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
     };
 
     // Given `lhses` and `rhses`, this is the new macro we create
-    fn generic_extension(cx: ext_ctxt, sp: span, arg: ~[ast::token_tree],
+    fn generic_extension(cx: ext_ctxt, sp: span, name: ident,
+                         arg: ~[ast::token_tree],
                          lhses: ~[@named_match], rhses: ~[@named_match])
     -> mac_result {
+
+        //io::println(fmt!("%s! { %s }", *name,
+        //                 print::pprust::unexpanded_tt_to_str(
+        //                     ast::tt_delim(arg),
+        //                     cx.parse_sess().interner)));
+
         // Which arm's failure should we report? (the one furthest along)
         let mut best_fail_spot = {lo: 0u, hi: 0u, expn_info: none};
         let mut best_fail_msg = ~"internal error: ran no matchers";
@@ -90,7 +97,8 @@ fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
         cx.span_fatal(best_fail_spot, best_fail_msg);
     }
 
-    let exp = |cx, sp, arg| generic_extension(cx, sp, arg, lhses, rhses);
+    let exp = |cx, sp, arg| generic_extension(cx, sp, name,
+                                              arg, lhses, rhses);
 
     return mr_def({
         ident: name,