diff options
author | Lukas Wirth <[email protected]> | 2020-12-24 08:26:03 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-12-24 08:36:47 +0000 |
commit | 3e0bb895418b2042ee9cd14b2444a36c87a3f449 (patch) | |
tree | 84b04d31e233ace40409e8f8664929563deaf3e1 /crates/parser | |
parent | fd1fcf2c2e90ab04103a6aa9d033ec64dcc8d555 (diff) |
Fix macro_rules not accepting brackets or parentheses
Diffstat (limited to 'crates/parser')
-rw-r--r-- | crates/parser/src/grammar/items.rs | 9 |
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 | } |