about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorEric Holk <eric.holk@gmail.com>2012-07-05 16:31:19 -0700
committerEric Holk <eric.holk@gmail.com>2012-07-06 10:42:40 -0700
commitd09bcc0131935e2ad403aa965e9be06ddcf01c08 (patch)
tree9dca498eeb8a64365d06d6cea20de530f4826fbe /src/libsyntax
parentf0ef4ef81b26388261ae56fdb019982ed3141668 (diff)
downloadrust-d09bcc0131935e2ad403aa965e9be06ddcf01c08.tar.gz
rust-d09bcc0131935e2ad403aa965e9be06ddcf01c08.zip
Adding token tree nonterminals to earley parser.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/pipes/pipec.rs2
-rw-r--r--src/libsyntax/ext/tt/earley_parser.rs1
-rw-r--r--src/libsyntax/parse/token.rs1
3 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs
index 0ff4ba92b36..4ad4eef636b 100644
--- a/src/libsyntax/ext/pipes/pipec.rs
+++ b/src/libsyntax/ext/pipes/pipec.rs
@@ -105,8 +105,6 @@ impl methods for message {
                               ast::by_copy)],
                 args_ast);
 
-            let args = [#fmt("-pipe: %s", *this.data_name())]/~ + args;
-
             let pat = alt (this.dir, next.dir) {
               (send, send) { "(c, s)" }
               (send, recv) { "(s, c)" }
diff --git a/src/libsyntax/ext/tt/earley_parser.rs b/src/libsyntax/ext/tt/earley_parser.rs
index 26db2842ef7..731d79573e7 100644
--- a/src/libsyntax/ext/tt/earley_parser.rs
+++ b/src/libsyntax/ext/tt/earley_parser.rs
@@ -272,6 +272,7 @@ fn parse_nt(p: parser, name: str) -> whole_nt {
                       + token::to_str(*p.reader.interner(), copy p.token)) }
       } }
       "path" { token::w_path(p.parse_path_with_tps(false)) }
+      "tt" { token::w_tt(p.parse_token_tree()) }
       _ { p.fatal("Unsupported builtin nonterminal parser: " + name)}
     }
 }
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 1fc8b10f385..ef1d0f4bc47 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -96,6 +96,7 @@ enum whole_nt {
     w_ty(  @ast::ty),
     w_ident(str_num, bool),
     w_path(@ast::path),
+    w_tt(ast::token_tree),
 }
 
 fn binop_to_str(o: binop) -> str {