From d6522ab2d3f7ab03c6d5d93ea196137823d2cfcf Mon Sep 17 00:00:00 2001 From: Paul Stansifer Date: Tue, 12 Jun 2012 10:50:17 -0700 Subject: Beginning of support for interpolation into token trees. --- src/libsyntax/parse/token.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/libsyntax/parse/token.rs') diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 981d7f9742e..7fb6165f7f1 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -77,9 +77,25 @@ enum token { /* Name components */ IDENT(str_num, bool), UNDERSCORE, + + //ACTUALLY(whole_nonterminal), + EOF, } +#[auto_serialize] +#[doc = "For interpolation during macro expansion."] +enum whole_nonterminal { + w_item(@ast::item), + w_block(ast::blk), + w_stmt(@ast::stmt), + w_pat( @ast::pat), + w_expr(@ast::expr), + w_ty( @ast::ty), + w_ident(ast::ident), + w_path(@ast::path), +} + fn binop_to_str(o: binop) -> str { alt o { PLUS { "+" } -- cgit 1.4.1-3-g733a5