aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-17 11:11:01 +0000
committerAleksey Kladov <[email protected]>2019-12-17 11:11:01 +0000
commit3e2f4e42937cb6e6855df94e424b55ed102af44d (patch)
tree193ec8e3cb01ed0a99770334c55778814c9c0d05 /crates/ra_parser
parentcb79e30d53d9aae843eb006f92212c2d5f888382 (diff)
Improve recovery for incomplete lambdas
Diffstat (limited to 'crates/ra_parser')
-rw-r--r--crates/ra_parser/src/grammar/expressions/atom.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs
index f06191963..09f0a2d98 100644
--- a/crates/ra_parser/src/grammar/expressions/atom.rs
+++ b/crates/ra_parser/src/grammar/expressions/atom.rs
@@ -248,7 +248,12 @@ fn lambda_expr(p: &mut Parser) -> CompletedMarker {
248 p.error("expected `{`"); 248 p.error("expected `{`");
249 } 249 }
250 } 250 }
251 expr(p); 251
252 if p.at_ts(EXPR_FIRST) {
253 expr(p);
254 } else {
255 p.error("expected expression");
256 }
252 m.complete(p, LAMBDA_EXPR) 257 m.complete(p, LAMBDA_EXPR)
253} 258}
254 259