From 7d4742e101f476de072834cb68b6c53dfb59ed07 Mon Sep 17 00:00:00 2001 From: Paul Stansifer Date: Wed, 1 Aug 2012 14:48:30 -0700 Subject: [PATCH] Allow `macro_rules! m { (...) => ... }` --- src/libsyntax/parse/parser.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 35d7e166306..29fdc884604 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1131,8 +1131,13 @@ class parser { // the interpolation of matchers maybe_whole!{self, nt_matchers}; let name_idx = @mut 0u; - return self.parse_matcher_subseq( - name_idx, token::LBRACE, token::RBRACE); + return alt self.token { + token::LBRACE | token::LPAREN | token::LBRACKET { + self.parse_matcher_subseq(name_idx, copy self.token, + token::flip_delimiter(self.token)) + } + _ { self.fatal(~"expected open delimiter"); } + } }