Beginning of support for interpolation into token trees.
This commit is contained in:
parent
d906fba636
commit
d6522ab2d3
2 changed files with 17 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 { "+" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue