aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-12-20 19:12:17 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-12-20 19:12:17 +0000
commit61dcaa6addcb3fca522b298bdba12239772eb81e (patch)
treeb2c4f6d9993fba31b6dd983dcf8c9430b46cf41b /crates/ra_syntax/src/grammar
parent057c95d3dd72725f13bfef25827b9034f19ba877 (diff)
parenta349db71784413afb25d80de9522c9e3995d3679 (diff)
Merge #304
304: Support a blank expression before a semicolon r=DJMcNab a=DJMcNab Part of fixing #290. Note that I have not run `gen-tests` as I don't want to conflict with #299. Co-authored-by: DJMcNab <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/grammar')
-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..da78d85a2 100644
--- a/crates/ra_syntax/src/grammar/expressions.rs
+++ b/crates/ra_syntax/src/grammar/expressions.rs
@@ -42,9 +42,15 @@ 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
45 while !p.at(EOF) && !p.at(R_CURLY) { 46 while !p.at(EOF) && !p.at(R_CURLY) {
46 match p.current() { 47 match p.current() {
47 LET_KW => let_stmt(p), 48 LET_KW => let_stmt(p),
49 // test nocontentexpr
50 // fn foo(){
51 // ;;;some_expr();;;;{;;;};;;;Ok(())
52 // }
53 SEMI => p.bump(),
48 _ => { 54 _ => {
49 // test block_items 55 // test block_items
50 // fn a() { fn b() {} } 56 // fn a() { fn b() {} }