diff options
Diffstat (limited to 'crates/ra_parser')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions/atom.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index ca6569c9f..0b01d3bc6 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs | |||
@@ -243,10 +243,12 @@ fn lambda_expr(p: &mut Parser) -> CompletedMarker { | |||
243 | // test lambda_ret_block | 243 | // test lambda_ret_block |
244 | // fn main() { || -> i32 { 92 }(); } | 244 | // fn main() { || -> i32 { 92 }(); } |
245 | block_expr(p); | 245 | block_expr(p); |
246 | } else if p.at_ts(EXPR_FIRST) { | ||
247 | expr(p); | ||
248 | } else { | 246 | } else { |
249 | p.error("expected expression"); | 247 | if p.at_ts(EXPR_FIRST) { |
248 | expr(p); | ||
249 | } else { | ||
250 | p.error("expected expression"); | ||
251 | } | ||
250 | } | 252 | } |
251 | m.complete(p, CLOSURE_EXPR) | 253 | m.complete(p, CLOSURE_EXPR) |
252 | } | 254 | } |