From dc1c64f5b95f91e716e7535d96618cb0e3c0b2f9 Mon Sep 17 00:00:00 2001 From: DJMcNab <36049421+DJMcNab@users.noreply.github.com> Date: Thu, 20 Dec 2018 18:24:38 +0000 Subject: Support a blank expression before a semicolon --- crates/ra_syntax/src/grammar/expressions.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/ra_syntax/src/grammar') diff --git a/crates/ra_syntax/src/grammar/expressions.rs b/crates/ra_syntax/src/grammar/expressions.rs index 1608b1a73..67fc17667 100644 --- a/crates/ra_syntax/src/grammar/expressions.rs +++ b/crates/ra_syntax/src/grammar/expressions.rs @@ -42,6 +42,11 @@ pub(crate) fn block(p: &mut Parser) { } let m = p.start(); p.bump(); + // test nocontentexpr + // fn foo(){ + // ;;;some_expr();;;;{;;;};;;;Ok(()) + // } + while p.eat(SEMI) {} while !p.at(EOF) && !p.at(R_CURLY) { match p.current() { LET_KW => let_stmt(p), @@ -89,6 +94,7 @@ pub(crate) fn block(p: &mut Parser) { } } } + while p.eat(SEMI) {} } p.expect(R_CURLY); m.complete(p, BLOCK); -- cgit v1.2.3