From e7d3ae606ed496144554dae499b69207da3b09c5 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 27 Oct 2015 22:20:01 -0700 Subject: Make quote plugin use parsing functions which explicitly panic. Rename parse_* to parse_*_panic, and add parse_attribute_panic. --- src/libsyntax/ext/quote.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 1e337c29f2b..59e8533a83d 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -327,7 +327,7 @@ pub fn expand_quote_expr<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box { - let expanded = expand_parse_call(cx, sp, "parse_expr", vec!(), tts); + let expanded = expand_parse_call(cx, sp, "parse_expr_panic", vec!(), tts); base::MacEager::expr(expanded) } @@ -335,7 +335,7 @@ pub fn expand_quote_item<'cx>(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box { - let expanded = expand_parse_call(cx, sp, "parse_item", vec!(), tts); + let expanded = expand_parse_call(cx, sp, "parse_item_panic", vec!(), tts); base::MacEager::expr(expanded) } @@ -343,7 +343,7 @@ pub fn expand_quote_pat<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box { - let expanded = expand_parse_call(cx, sp, "parse_pat", vec!(), tts); + let expanded = expand_parse_call(cx, sp, "parse_pat_panic", vec!(), tts); base::MacEager::expr(expanded) } @@ -351,7 +351,7 @@ pub fn expand_quote_arm(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box { - let expanded = expand_parse_call(cx, sp, "parse_arm", vec!(), tts); + let expanded = expand_parse_call(cx, sp, "parse_arm_panic", vec!(), tts); base::MacEager::expr(expanded) } @@ -359,7 +359,7 @@ pub fn expand_quote_ty(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box { - let expanded = expand_parse_call(cx, sp, "parse_ty", vec!(), tts); + let expanded = expand_parse_call(cx, sp, "parse_ty_panic", vec!(), tts); base::MacEager::expr(expanded) } @@ -367,7 +367,7 @@ pub fn expand_quote_stmt(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box { - let expanded = expand_parse_call(cx, sp, "parse_stmt", vec!(), tts); + let expanded = expand_parse_call(cx, sp, "parse_stmt_panic", vec!(), tts); base::MacEager::expr(expanded) } @@ -375,7 +375,7 @@ pub fn expand_quote_attr(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box { - let expanded = expand_parse_call(cx, sp, "parse_attribute", + let expanded = expand_parse_call(cx, sp, "parse_attribute_panic", vec!(cx.expr_bool(sp, true)), tts); base::MacEager::expr(expanded) -- cgit 1.4.1-3-g733a5