diff options
Diffstat (limited to 'crates/parser/src')
-rw-r--r-- | crates/parser/src/grammar.rs | 2 | ||||
-rw-r--r-- | crates/parser/src/grammar/items.rs | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index f08c8bab7..63cc90027 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs | |||
@@ -59,7 +59,7 @@ pub(crate) mod fragments { | |||
59 | }; | 59 | }; |
60 | 60 | ||
61 | pub(crate) fn expr(p: &mut Parser) { | 61 | pub(crate) fn expr(p: &mut Parser) { |
62 | let _ = expressions::expr(p); | 62 | let _ = expressions::expr_with_attrs(p); |
63 | } | 63 | } |
64 | 64 | ||
65 | pub(crate) fn stmt(p: &mut Parser) { | 65 | pub(crate) fn stmt(p: &mut Parser) { |
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 | } |