From f7960ac5494518268626e176481c0644345d2c35 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 7 Nov 2012 15:16:58 -0800 Subject: [PATCH] Revert "`m1!{...}` is now forbidden. Use `m1!(...)` instead." This reverts commit 89bbaff84fed6e6796c82f5a9fd200e693d47beb. --- src/libsyntax/parse/parser.rs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f1f49c63a7d..abf3e9164b1 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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,