Make it possible to invoke item macros without passing identifier arguments.

This commit is contained in:
Paul Stansifer 2012-11-08 23:12:45 -05:00 committed by Graydon Hoare
parent cafea5ecb6
commit fca52554e7
4 changed files with 55 additions and 33 deletions

View file

@ -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);