libsyntax: Make the parser mutable

This commit is contained in:
Patrick Walton
2013-12-30 14:04:00 -08:00
parent 0df9b850ac
commit f499d365ad
13 changed files with 518 additions and 487 deletions

View File

@@ -442,9 +442,9 @@ pub fn get_single_str_from_tts(cx: &ExtCtxt,
pub fn get_exprs_from_tts(cx: &ExtCtxt,
sp: Span,
tts: &[ast::token_tree]) -> ~[@ast::Expr] {
let p = parse::new_parser_from_tts(cx.parse_sess(),
cx.cfg(),
tts.to_owned());
let mut p = parse::new_parser_from_tts(cx.parse_sess(),
cx.cfg(),
tts.to_owned());
let mut es = ~[];
while *p.token != token::EOF {
if es.len() != 0 && !p.eat(&token::COMMA) {