Skip to content

Commit d6522ab

Browse files
committed
Beginning of support for interpolation into token trees.
1 parent d906fba commit d6522ab

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/libsyntax/parse/lexer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn new_tt_reader(span_diagnostic: diagnostic::span_handler,
4545
mut cur_tok: token::EOF, /* dummy value, never read */
4646
mut cur_chpos: 0u /* dummy value, never read */
4747
};
48-
//tt_next_token(r); /* get cur_tok and cur_chpos set up */
48+
tt_next_token(r); /* get cur_tok and cur_chpos set up */
4949
ret r;
5050
}
5151

src/libsyntax/parse/token.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,25 @@ enum token {
7777
/* Name components */
7878
IDENT(str_num, bool),
7979
UNDERSCORE,
80+
81+
//ACTUALLY(whole_nonterminal),
82+
8083
EOF,
8184
}
8285

86+
#[auto_serialize]
87+
#[doc = "For interpolation during macro expansion."]
88+
enum whole_nonterminal {
89+
w_item(@ast::item),
90+
w_block(ast::blk),
91+
w_stmt(@ast::stmt),
92+
w_pat( @ast::pat),
93+
w_expr(@ast::expr),
94+
w_ty( @ast::ty),
95+
w_ident(ast::ident),
96+
w_path(@ast::path),
97+
}
98+
8399
fn binop_to_str(o: binop) -> str {
84100
alt o {
85101
PLUS { "+" }

0 commit comments

Comments
 (0)