From 44d8abcc0f372dbc7ad58f312303d2e59612dec9 Mon Sep 17 00:00:00 2001 From: Kyle Mayes Date: Fri, 13 Nov 2015 22:18:59 -0500 Subject: 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. --- src/libsyntax/parse/parser.rs | 47 ------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index c82c6dcdea3..bde910838cb 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -362,53 +362,6 @@ impl<'a> Parser<'a> { } } - // Panicing fns (for now!) - // These functions are used by the quote_*!() syntax extensions, but shouldn't - // be used otherwise. - pub fn parse_expr_panic(&mut self) -> P { - panictry!(self.parse_expr()) - } - - pub fn parse_item_panic(&mut self) -> Option> { - panictry!(self.parse_item()) - } - - pub fn parse_pat_panic(&mut self) -> P { - panictry!(self.parse_pat()) - } - - pub fn parse_arm_panic(&mut self) -> Arm { - panictry!(self.parse_arm()) - } - - pub fn parse_ty_panic(&mut self) -> P { - panictry!(self.parse_ty()) - } - - pub fn parse_stmt_panic(&mut self) -> Option> { - panictry!(self.parse_stmt()) - } - - pub fn parse_attribute_panic(&mut self, permit_inner: bool) -> ast::Attribute { - panictry!(self.parse_attribute(permit_inner)) - } - - pub fn parse_arg_panic(&mut self) -> Arg { - panictry!(self.parse_arg()) - } - - pub fn parse_block_panic(&mut self) -> P { - panictry!(self.parse_block()) - } - - pub fn parse_meta_item_panic(&mut self) -> P { - panictry!(self.parse_meta_item()) - } - - pub fn parse_path_panic(&mut self, mode: PathParsingMode) -> ast::Path { - panictry!(self.parse_path(mode)) - } - /// Convert a token to a string using self's reader pub fn token_to_string(token: &token::Token) -> String { pprust::token_to_string(token) -- cgit 1.4.1-3-g733a5