aboutsummaryrefslogtreecommitdiff
path: root/crates/parser
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-24 08:44:52 +0000
committerGitHub <[email protected]>2020-12-24 08:44:52 +0000
commit1487f2f10efe2d0a54e8627692643f3a48ffdbff (patch)
treec65db09490068db8a725d870eb65df579e7e41f5 /crates/parser
parent2c843c477615d46372ae0ffc4a1ab5c622bd2995 (diff)
parent3e0bb895418b2042ee9cd14b2444a36c87a3f449 (diff)
Merge #7027
7027: Fix macro_rules not accepting brackets or parentheses r=matklad,lnicola a=Veykril Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/parser')
-rw-r--r--crates/parser/src/grammar/items.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs
index 72b73f891..cf4168d32 100644
--- a/crates/parser/src/grammar/items.rs
+++ b/crates/parser/src/grammar/items.rs
@@ -389,10 +389,15 @@ fn macro_rules(p: &mut Parser, m: Marker) {
389 } 389 }
390 390
391 match p.current() { 391 match p.current() {
392 T!['{'] => { 392 // test macro_rules_non_brace
393 // macro_rules! m ( ($i:ident) => {} );
394 // macro_rules! m [ ($i:ident) => {} ];
395 T!['['] | T!['('] => {
393 token_tree(p); 396 token_tree(p);
397 p.expect(T![;]);
394 } 398 }
395 _ => p.error("expected `{`"), 399 T!['{'] => token_tree(p),
400 _ => p.error("expected `{`, `[`, `(`"),
396 } 401 }
397 m.complete(p, MACRO_RULES); 402 m.complete(p, MACRO_RULES);
398} 403}