Move the panicking parse functions out of the parser

Since these functions are only used by the AST quoting syntax extensions, they should be there instead of in the parser.
This commit is contained in:
Kyle Mayes 2015-11-13 22:18:59 -05:00
parent c10569cac5
commit 44d8abcc0f
3 changed files with 53 additions and 51 deletions

View file

@ -54,7 +54,7 @@ fn expand_identity(cx: &mut ExtCtxt, _span: Span, tts: &[TokenTree])
// Parse an expression and emit it unchanged.
let mut parser = parse::new_parser_from_tts(cx.parse_sess(),
cx.cfg(), tts.to_vec());
let expr = parser.parse_expr_panic();
let expr = parser.parse_expr().unwrap();
MacEager::expr(quote_expr!(&mut *cx, $expr))
}