diff options
| author | bors <bors@rust-lang.org> | 2017-08-18 08:17:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-08-18 08:17:45 +0000 |
| commit | e6ab51165a1b67409c1ee1efeaf0cd139dc6c592 (patch) | |
| tree | 171566dee7bf0879f42eb6b97335d85fe23026d7 /src/libstd/sys/unix/process/process_unix.rs | |
| parent | 8016eea9dc8c6c4a56310ecf9c28f4a389e06ac3 (diff) | |
| parent | 0bfe4178af1c82a7907c3408e3fe910f47948bf5 (diff) | |
| download | rust-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
