diff options
Diffstat (limited to 'crates/ra_syntax/src/grammar/expressions.rs')
-rw-r--r-- | crates/ra_syntax/src/grammar/expressions.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/grammar/expressions.rs b/crates/ra_syntax/src/grammar/expressions.rs index 5f5a3077d..4f8c46ab3 100644 --- a/crates/ra_syntax/src/grammar/expressions.rs +++ b/crates/ra_syntax/src/grammar/expressions.rs | |||
@@ -73,6 +73,10 @@ pub(crate) fn block(p: &mut Parser) { | |||
73 | // for _ in () {} | 73 | // for _ in () {} |
74 | // {} | 74 | // {} |
75 | // {} | 75 | // {} |
76 | // macro_rules! test { | ||
77 | // () => {} | ||
78 | // } | ||
79 | // test!{} | ||
76 | // } | 80 | // } |
77 | if is_blocklike { | 81 | if is_blocklike { |
78 | p.eat(SEMI); | 82 | p.eat(SEMI); |
@@ -168,13 +172,13 @@ fn current_op(p: &Parser) -> (u8, Op) { | |||
168 | // Parses expression with binding power of at least bp. | 172 | // Parses expression with binding power of at least bp. |
169 | fn expr_bp(p: &mut Parser, r: Restrictions, bp: u8) -> BlockLike { | 173 | fn expr_bp(p: &mut Parser, r: Restrictions, bp: u8) -> BlockLike { |
170 | let mut lhs = match lhs(p, r) { | 174 | let mut lhs = match lhs(p, r) { |
171 | Some((lhs, macro_blocklike)) => { | 175 | Some((lhs, blocklike)) => { |
172 | // test stmt_bin_expr_ambiguity | 176 | // test stmt_bin_expr_ambiguity |
173 | // fn foo() { | 177 | // fn foo() { |
174 | // let _ = {1} & 2; | 178 | // let _ = {1} & 2; |
175 | // {1} &2; | 179 | // {1} &2; |
176 | // } | 180 | // } |
177 | if r.prefer_stmt && macro_blocklike.is_block() { | 181 | if r.prefer_stmt && blocklike.is_block() { |
178 | return BlockLike::Block; | 182 | return BlockLike::Block; |
179 | } | 183 | } |
180 | lhs | 184 | lhs |