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

@ -81,9 +81,13 @@ pub fn expand_include(cx: &mut ExtCtxt, sp: Span, tts: &[ast::token_tree])
-> base::MacResult {
let file = get_single_str_from_tts(cx, sp, tts, "include!");
// The file will be added to the code map by the parser
let p = parse::new_sub_parser_from_file(
cx.parse_sess(), cx.cfg(),
&res_rel_file(cx, sp, &Path::new(file)), sp);
let mut p =
parse::new_sub_parser_from_file(cx.parse_sess(),
cx.cfg(),
&res_rel_file(cx,
sp,
&Path::new(file)),
sp);
base::MRExpr(p.parse_expr())
}