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:
parent
c10569cac5
commit
44d8abcc0f
3 changed files with 53 additions and 51 deletions
|
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue