aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/expressions
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions')
-rw-r--r--crates/ra_parser/src/grammar/expressions/atom.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs
index f06191963..4ac1d6334 100644
--- a/crates/ra_parser/src/grammar/expressions/atom.rs
+++ b/crates/ra_parser/src/grammar/expressions/atom.rs
@@ -43,6 +43,7 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet =
43 T!['('], 43 T!['('],
44 T!['{'], 44 T!['{'],
45 T!['['], 45 T!['['],
46 L_DOLLAR,
46 T![|], 47 T![|],
47 T![move], 48 T![move],
48 T![box], 49 T![box],
@@ -248,7 +249,12 @@ fn lambda_expr(p: &mut Parser) -> CompletedMarker {
248 p.error("expected `{`"); 249 p.error("expected `{`");
249 } 250 }
250 } 251 }
251 expr(p); 252
253 if p.at_ts(EXPR_FIRST) {
254 expr(p);
255 } else {
256 p.error("expected expression");
257 }
252 m.complete(p, LAMBDA_EXPR) 258 m.complete(p, LAMBDA_EXPR)
253} 259}
254 260
@@ -438,7 +444,7 @@ fn match_arm(p: &mut Parser) -> BlockLike {
438 // } 444 // }
439 attributes::outer_attributes(p); 445 attributes::outer_attributes(p);
440 446
441 patterns::pattern_list_r(p, TokenSet::empty()); 447 patterns::pattern_list_r(p, TokenSet::EMPTY);
442 if p.at(T![if]) { 448 if p.at(T![if]) {
443 match_guard(p); 449 match_guard(p);
444 } 450 }