diff options
Diffstat (limited to 'crates/parser/src')
-rw-r--r-- | crates/parser/src/grammar/expressions/atom.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs index 269f223e6..abdfca1fe 100644 --- a/crates/parser/src/grammar/expressions/atom.rs +++ b/crates/parser/src/grammar/expressions/atom.rs | |||
@@ -252,12 +252,10 @@ fn closure_expr(p: &mut Parser) -> CompletedMarker { | |||
252 | // test lambda_ret_block | 252 | // test lambda_ret_block |
253 | // fn main() { || -> i32 { 92 }(); } | 253 | // fn main() { || -> i32 { 92 }(); } |
254 | block_expr(p); | 254 | block_expr(p); |
255 | } else if p.at_ts(EXPR_FIRST) { | ||
256 | expr(p); | ||
255 | } else { | 257 | } else { |
256 | if p.at_ts(EXPR_FIRST) { | 258 | p.error("expected expression"); |
257 | expr(p); | ||
258 | } else { | ||
259 | p.error("expected expression"); | ||
260 | } | ||
261 | } | 259 | } |
262 | m.complete(p, CLOSURE_EXPR) | 260 | m.complete(p, CLOSURE_EXPR) |
263 | } | 261 | } |