diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-11-08 23:12:45 -0500 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-11-29 12:09:10 -0800 |
| commit | fca52554e7e3b3eff0aaf8686fe4616628577ade (patch) | |
| tree | cf48e7031d7943d2bc5cd9eafc56c7abd8975a15 /src/libsyntax/parse | |
| parent | cafea5ecb69ad9439502426a69e5d297c4525758 (diff) | |
| download | rust-fca52554e7e3b3eff0aaf8686fe4616628577ade.tar.gz rust-fca52554e7e3b3eff0aaf8686fe4616628577ade.zip | |
Make it possible to invoke item macros without passing identifier arguments.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index e521a698da7..638a02775d9 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3534,7 +3534,11 @@ impl Parser { // item macro. let pth = self.parse_path_without_tps(); self.expect(token::NOT); - let id = self.parse_ident(); + let id = if self.token == token::LPAREN { + token::special_idents::invalid // no special identifier + } else { + self.parse_ident() + }; let tts = match self.token { token::LPAREN | token::LBRACE => { let ket = token::flip_delimiter(copy self.token); |
