diff options
| author | Kyle Mayes <kyle@mayeses.com> | 2015-11-11 15:19:01 -0500 |
|---|---|---|
| committer | Kyle Mayes <kyle@mayeses.com> | 2015-11-11 15:19:01 -0500 |
| commit | 8c88308c68691b795815a776d41b3aa11717c146 (patch) | |
| tree | 74b789f44c7e1728f003cc5d54e121ef849b1609 /src/libsyntax/parse/parser.rs | |
| parent | f1f5c04c07f2e888c43cb577810659a7c1d87a00 (diff) | |
| download | rust-8c88308c68691b795815a776d41b3aa11717c146.tar.gz rust-8c88308c68691b795815a776d41b3aa11717c146.zip | |
libsyntax: Add more quasiquoting macros
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index fde1058a785..f5e4114464f 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -393,6 +393,22 @@ impl<'a> Parser<'a> { 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) @@ -1455,6 +1471,8 @@ impl<'a> Parser<'a> { /// This version of parse arg doesn't necessarily require /// identifier names. pub fn parse_arg_general(&mut self, require_name: bool) -> PResult<Arg> { + maybe_whole!(no_clone self, NtArg); + let pat = if require_name || self.is_named_argument() { debug!("parse_arg_general parse_pat (require_name:{})", require_name); |
