diff options
Diffstat (limited to 'crates/ra_syntax/src/grammar/expressions.rs')
-rw-r--r-- | crates/ra_syntax/src/grammar/expressions.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/crates/ra_syntax/src/grammar/expressions.rs b/crates/ra_syntax/src/grammar/expressions.rs index 6b88c5685..28fcb1f7d 100644 --- a/crates/ra_syntax/src/grammar/expressions.rs +++ b/crates/ra_syntax/src/grammar/expressions.rs | |||
@@ -7,26 +7,17 @@ use super::*; | |||
7 | const EXPR_FIRST: TokenSet = LHS_FIRST; | 7 | const EXPR_FIRST: TokenSet = LHS_FIRST; |
8 | 8 | ||
9 | pub(super) fn expr(p: &mut Parser) -> BlockLike { | 9 | pub(super) fn expr(p: &mut Parser) -> BlockLike { |
10 | let r = Restrictions { | 10 | let r = Restrictions { forbid_structs: false, prefer_stmt: false }; |
11 | forbid_structs: false, | ||
12 | prefer_stmt: false, | ||
13 | }; | ||
14 | expr_bp(p, r, 1) | 11 | expr_bp(p, r, 1) |
15 | } | 12 | } |
16 | 13 | ||
17 | pub(super) fn expr_stmt(p: &mut Parser) -> BlockLike { | 14 | pub(super) fn expr_stmt(p: &mut Parser) -> BlockLike { |
18 | let r = Restrictions { | 15 | let r = Restrictions { forbid_structs: false, prefer_stmt: true }; |
19 | forbid_structs: false, | ||
20 | prefer_stmt: true, | ||
21 | }; | ||
22 | expr_bp(p, r, 1) | 16 | expr_bp(p, r, 1) |
23 | } | 17 | } |
24 | 18 | ||
25 | fn expr_no_struct(p: &mut Parser) { | 19 | fn expr_no_struct(p: &mut Parser) { |
26 | let r = Restrictions { | 20 | let r = Restrictions { forbid_structs: true, prefer_stmt: false }; |
27 | forbid_structs: true, | ||
28 | prefer_stmt: false, | ||
29 | }; | ||
30 | expr_bp(p, r, 1); | 21 | expr_bp(p, r, 1); |
31 | } | 22 | } |
32 | 23 | ||