aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-03-04 12:42:21 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-03-04 12:42:21 +0000
commit8a5d48b6c6e180017e47175a07f77f4f7ec6549d (patch)
treea6d825136ef86cef49f57d1cf358911d24735b21 /crates/ra_parser/src/grammar
parent5197e1664856fa4fef5a4c4dd43b6915e9fa847d (diff)
parent77f2381eea2ca4da6c6d7dc81322be542e3dbb87 (diff)
Merge #925
925: improve error recovery r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r--crates/ra_parser/src/grammar/expressions.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs
index d5a4f4d7b..70c71a8e1 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/ra_parser/src/grammar/expressions.rs
@@ -33,6 +33,12 @@ pub(crate) fn block(p: &mut Parser) {
33 } 33 }
34 let m = p.start(); 34 let m = p.start();
35 p.bump(); 35 p.bump();
36 expr_block_contents(p);
37 p.expect(R_CURLY);
38 m.complete(p, BLOCK);
39}
40
41pub(crate) fn expr_block_contents(p: &mut Parser) {
36 // This is checked by a validator 42 // This is checked by a validator
37 attributes::inner_attributes(p); 43 attributes::inner_attributes(p);
38 44
@@ -101,8 +107,6 @@ pub(crate) fn block(p: &mut Parser) {
101 } 107 }
102 } 108 }
103 } 109 }
104 p.expect(R_CURLY);
105 m.complete(p, BLOCK);
106 110
107 // test let_stmt; 111 // test let_stmt;
108 // fn foo() { 112 // fn foo() {