aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorDJMcNab <[email protected]>2018-12-20 18:24:38 +0000
committerDJMcNab <[email protected]>2018-12-20 19:07:11 +0000
commitdc1c64f5b95f91e716e7535d96618cb0e3c0b2f9 (patch)
treecf5ca2a03c977c1003b4a3cef4d27f8b9999031a /crates
parent057c95d3dd72725f13bfef25827b9034f19ba877 (diff)
Support a blank expression before a semicolon
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_syntax/src/grammar/expressions.rs6
1 files changed, 6 insertions, 0 deletions
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) {
42 } 42 }
43 let m = p.start(); 43 let m = p.start();
44 p.bump(); 44 p.bump();
45 // test nocontentexpr
46 // fn foo(){
47 // ;;;some_expr();;;;{;;;};;;;Ok(())
48 // }
49 while p.eat(SEMI) {}
45 while !p.at(EOF) && !p.at(R_CURLY) { 50 while !p.at(EOF) && !p.at(R_CURLY) {
46 match p.current() { 51 match p.current() {
47 LET_KW => let_stmt(p), 52 LET_KW => let_stmt(p),
@@ -89,6 +94,7 @@ pub(crate) fn block(p: &mut Parser) {
89 } 94 }
90 } 95 }
91 } 96 }
97 while p.eat(SEMI) {}
92 } 98 }
93 p.expect(R_CURLY); 99 p.expect(R_CURLY);
94 m.complete(p, BLOCK); 100 m.complete(p, BLOCK);