summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
diff options
context:
space:
mode:
authorPaul Stansifer <paul.stansifer@gmail.com>2012-06-29 18:26:34 -0700
committerPaul Stansifer <paul.stansifer@gmail.com>2012-07-05 18:09:31 -0700
commit0c6fe6470e6a19899bd32add0a282d3ae2a97b8a (patch)
tree4b9ac214483a3190ea5043adab6cb3f965515da2 /src/libsyntax/parse/token.rs
parentf4fb975e4eeb88f5b92b75a5df1e4e6c19856b42 (diff)
downloadrust-0c6fe6470e6a19899bd32add0a282d3ae2a97b8a.tar.gz
rust-0c6fe6470e6a19899bd32add0a282d3ae2a97b8a.zip
Macro By Example transcription of token trees with interpolations and dotdotdots.
Diffstat (limited to 'src/libsyntax/parse/token.rs')
-rw-r--r--src/libsyntax/parse/token.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index c4ae9269914..29a8fb18ebc 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -78,7 +78,8 @@ enum token {
     IDENT(str_num, bool),
     UNDERSCORE,
 
-    //ACTUALLY(whole_nonterminal),
+    /* For interpolation */
+    ACTUALLY(whole_nt),
 
     DOC_COMMENT(str_num),
     EOF,
@@ -181,6 +182,15 @@ fn to_str(in: interner<@str>, t: token) -> str {
       /* Other */
       DOC_COMMENT(s) { *interner::get(in, s) }
       EOF { "<eof>" }
+      ACTUALLY(w_nt) {
+        "an interpolated " +
+            alt w_nt {
+              w_item(*) { "item" } w_block(*) { "block" }
+              w_stmt(*) { "statement" } w_pat(*) { "pattern" }
+              w_expr(*) { "expression" } w_ty(*) { "type" }
+              w_ident(*) { "identifier" } w_path(*) { "path" }
+        }
+      }
     }
 }