diff options
| author | bors <bors@rust-lang.org> | 2014-10-08 02:52:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-08 02:52:08 +0000 |
| commit | 593174b42d522f7c5e90ea18402cf67306e2481d (patch) | |
| tree | 16f8be555768e5250ddbf8dc2325da6a022b4c26 /src/libsyntax | |
| parent | 0606234880ac8318a8e247e836ac61b32c63e9f9 (diff) | |
| parent | fc60797f7f3079288bdd1717dedbb885eaf1dbfa (diff) | |
| download | rust-593174b42d522f7c5e90ea18402cf67306e2481d.tar.gz rust-593174b42d522f7c5e90ea18402cf67306e2481d.zip | |
auto merge of #17838 : vadimcn/rust/macros, r=alexcrichton
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 090b39eee47..88376108fec 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -350,7 +350,16 @@ pub fn parse(sess: &ParseSess, sp_lo: sp.lo }); } - MatchNonterminal(_,_,_) => { bb_eis.push(ei) } + MatchNonterminal(_,_,_) => { + // Built-in nonterminals never start with these tokens, + // so we can eliminate them from consideration. + match tok { + token::RPAREN | + token::RBRACE | + token::RBRACKET => {}, + _ => bb_eis.push(ei) + } + } MatchTok(ref t) => { let mut ei_t = ei.clone(); if token_name_eq(t,&tok) { |
