diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-06-12 10:50:17 -0700 |
|---|---|---|
| committer | Paul Stansifer <paul.stansifer@gmail.com> | 2012-06-15 12:41:41 -0700 |
| commit | d6522ab2d3f7ab03c6d5d93ea196137823d2cfcf (patch) | |
| tree | 22fbcaa419a7f10e75a728f810a21b13875561e9 /src/libsyntax | |
| parent | d906fba63621d049bdbd0fe9478fef383efb2341 (diff) | |
| download | rust-d6522ab2d3f7ab03c6d5d93ea196137823d2cfcf.tar.gz rust-d6522ab2d3f7ab03c6d5d93ea196137823d2cfcf.zip | |
Beginning of support for interpolation into token trees.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 28369dbb5a5..8849da5d270 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -45,7 +45,7 @@ fn new_tt_reader(span_diagnostic: diagnostic::span_handler, mut cur_tok: token::EOF, /* dummy value, never read */ mut cur_chpos: 0u /* dummy value, never read */ }; - //tt_next_token(r); /* get cur_tok and cur_chpos set up */ + tt_next_token(r); /* get cur_tok and cur_chpos set up */ ret r; } 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 { "+" } |
