diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2017-08-21 10:41:56 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2017-08-21 10:41:56 -0700 |
| commit | b31998ec93c1738642fd1557b419fa651bb6b543 (patch) | |
| tree | c9461144895ec8d0f937fd16b7f5fbf2942e6706 /src/libsyntax/parse | |
| parent | bf3ebcc98788d805f96b171362d272c93e0a50a0 (diff) | |
| parent | 757b7ac2abd69d97ba196b76f0bbf78c377aaea9 (diff) | |
| download | rust-b31998ec93c1738642fd1557b419fa651bb6b543.tar.gz rust-b31998ec93c1738642fd1557b419fa651bb6b543.zip | |
Merge remote-tracking branch 'origin/master' into gen
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/attr.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index 5dc5a53e279..48c92873e14 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -244,10 +244,9 @@ impl<'a> Parser<'a> { pub fn parse_meta_item_kind(&mut self) -> PResult<'a, ast::MetaItemKind> { Ok(if self.eat(&token::Eq) { ast::MetaItemKind::NameValue(self.parse_unsuffixed_lit()?) - } else if self.token == token::OpenDelim(token::Paren) { + } else if self.eat(&token::OpenDelim(token::Paren)) { ast::MetaItemKind::List(self.parse_meta_seq()?) } else { - self.eat(&token::OpenDelim(token::Paren)); ast::MetaItemKind::Word }) } @@ -277,9 +276,8 @@ impl<'a> Parser<'a> { /// matches meta_seq = ( COMMASEP(meta_item_inner) ) fn parse_meta_seq(&mut self) -> PResult<'a, Vec<ast::NestedMetaItem>> { - self.parse_unspanned_seq(&token::OpenDelim(token::Paren), - &token::CloseDelim(token::Paren), - SeqSep::trailing_allowed(token::Comma), - |p: &mut Parser<'a>| p.parse_meta_item_inner()) + self.parse_seq_to_end(&token::CloseDelim(token::Paren), + SeqSep::trailing_allowed(token::Comma), + |p: &mut Parser<'a>| p.parse_meta_item_inner()) } } |
