From 07cbb7d73deed8dac3eecdbdc7e1eaf6938a6cd6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 27 Aug 2018 12:22:09 +0300 Subject: Support if-let in scopes --- crates/libsyntax2/src/grammar/expressions/atom.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/libsyntax2/src/grammar') diff --git a/crates/libsyntax2/src/grammar/expressions/atom.rs b/crates/libsyntax2/src/grammar/expressions/atom.rs index d9c3f998a..bb5402af7 100644 --- a/crates/libsyntax2/src/grammar/expressions/atom.rs +++ b/crates/libsyntax2/src/grammar/expressions/atom.rs @@ -237,11 +237,13 @@ fn for_expr(p: &mut Parser, m: Option) -> CompletedMarker { // test cond // fn foo() { if let Some(_) = None {} } fn cond(p: &mut Parser) { + let m = p.start(); if p.eat(LET_KW) { patterns::pattern(p); p.expect(EQ); } - expr_no_struct(p) + expr_no_struct(p); + m.complete(p, CONDITION); } // test match_expr -- cgit v1.2.3