about summary refs log tree commit diff
path: root/src/libstd/sys/unix/process/process_unix.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-08-18 08:17:45 +0000
committerbors <bors@rust-lang.org>2017-08-18 08:17:45 +0000
commite6ab51165a1b67409c1ee1efeaf0cd139dc6c592 (patch)
tree171566dee7bf0879f42eb6b97335d85fe23026d7 /src/libstd/sys/unix/process/process_unix.rs
parent8016eea9dc8c6c4a56310ecf9c28f4a389e06ac3 (diff)
parent0bfe4178af1c82a7907c3408e3fe910f47948bf5 (diff)
downloadrust-e6ab51165a1b67409c1ee1efeaf0cd139dc6c592.tar.gz
rust-e6ab51165a1b67409c1ee1efeaf0cd139dc6c592.zip
Auto merge of #43904 - topecongiro:libsyntax/parse-attr, r=petrochenkov
Eat open paren when parsing list in libsyntax/parse/attr.rs

This PR adds a small refactoring:
```diff
      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
         })
     }
```
in `parse_meta_item_kind()`, the parser calls `self.eat(&token::OpenDelim(token::Paren));` before returning `ast::MetaItemKind::Word` just to add `(` to expected token. It seems more natural to eat the paren when parsing `ast::MetaItemKind::List`.
Diffstat (limited to 'src/libstd/sys/unix/process/process_unix.rs')
0 files changed, 0 insertions, 0 deletions