Revert "m1!{...} is now forbidden. Use m1!(...) instead."

This reverts commit 89bbaff84f.
This commit is contained in:
Graydon Hoare 2012-11-07 15:16:58 -08:00
parent 4e1ce014c8
commit f7960ac549

View File

@ -1082,10 +1082,15 @@ impl Parser {
/* `!`, as an operator, is prefix, so we know this isn't that */
if self.token == token::NOT {
self.bump();
let tts = self.parse_unspanned_seq(
token::LPAREN, token::RPAREN, seq_sep_none(),
|p| p.parse_token_tree());
let tts = match self.token {
token::LPAREN | token::LBRACE | token::LBRACKET => {
let ket = token::flip_delimiter(self.token);
self.parse_unspanned_seq(copy self.token, ket,
seq_sep_none(),
|p| p.parse_token_tree())
}
_ => self.fatal(~"expected open delimiter")
};
let hi = self.span.hi;
return self.mk_mac_expr(
@ -3412,9 +3417,15 @@ impl Parser {
let pth = self.parse_path_without_tps();
self.expect(token::NOT);
let id = self.parse_ident();
let tts = self.parse_unspanned_seq(
token::LPAREN, token::RPAREN, seq_sep_none(),
|p| p.parse_token_tree());
let tts = match self.token {
token::LPAREN | token::LBRACE | token::LBRACKET => {
let ket = token::flip_delimiter(self.token);
self.parse_unspanned_seq(copy self.token, ket,
seq_sep_none(),
|p| p.parse_token_tree())
}
_ => self.fatal(~"expected open delimiter")
};
let m = ast::mac_invoc_tt(pth, tts);
let m: ast::mac = {node: m,
span: {lo: self.span.lo,