diff options
| author | Kyle Mayes <kyle@mayeses.com> | 2015-11-13 22:18:59 -0500 |
|---|---|---|
| committer | Kyle Mayes <kyle@mayeses.com> | 2015-11-13 22:18:59 -0500 |
| commit | 44d8abcc0f372dbc7ad58f312303d2e59612dec9 (patch) | |
| tree | e3864d10608c8235eb0582ffd30cde25e558fd68 /src/libsyntax/parse | |
| parent | c10569cac5561167c10359d20a3ca38dc4ae2efa (diff) | |
| download | rust-44d8abcc0f372dbc7ad58f312303d2e59612dec9.tar.gz rust-44d8abcc0f372dbc7ad58f312303d2e59612dec9.zip | |
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.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 47 |
1 files changed, 0 insertions, 47 deletions
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<Expr> { - panictry!(self.parse_expr()) - } - - pub fn parse_item_panic(&mut self) -> Option<P<Item>> { - panictry!(self.parse_item()) - } - - pub fn parse_pat_panic(&mut self) -> P<Pat> { - panictry!(self.parse_pat()) - } - - pub fn parse_arm_panic(&mut self) -> Arm { - panictry!(self.parse_arm()) - } - - pub fn parse_ty_panic(&mut self) -> P<Ty> { - panictry!(self.parse_ty()) - } - - pub fn parse_stmt_panic(&mut self) -> Option<P<Stmt>> { - 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<Block> { - panictry!(self.parse_block()) - } - - pub fn parse_meta_item_panic(&mut self) -> P<ast::MetaItem> { - 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) |
