diff options
Diffstat (limited to 'crates/ra_parser/src/grammar/expressions.rs')
-rw-r--r-- | crates/ra_parser/src/grammar/expressions.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index a23dbcacf..34f039768 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | mod atom; | 3 | mod atom; |
4 | 4 | ||
5 | pub(crate) use self::atom::match_arm_list; | 5 | pub(crate) use self::atom::{block_expr, match_arm_list}; |
6 | pub(super) use self::atom::{literal, LITERAL_FIRST}; | 6 | pub(super) use self::atom::{literal, LITERAL_FIRST}; |
7 | use super::*; | 7 | use super::*; |
8 | 8 | ||
@@ -49,19 +49,6 @@ fn expr_no_struct(p: &mut Parser) { | |||
49 | expr_bp(p, r, 1); | 49 | expr_bp(p, r, 1); |
50 | } | 50 | } |
51 | 51 | ||
52 | // test block | ||
53 | // fn a() {} | ||
54 | // fn b() { let _ = 1; } | ||
55 | // fn c() { 1; 2; } | ||
56 | // fn d() { 1; 2 } | ||
57 | pub(crate) fn block(p: &mut Parser) { | ||
58 | if !p.at(T!['{']) { | ||
59 | p.error("expected a block"); | ||
60 | return; | ||
61 | } | ||
62 | atom::block_expr(p); | ||
63 | } | ||
64 | |||
65 | fn is_expr_stmt_attr_allowed(kind: SyntaxKind) -> bool { | 52 | fn is_expr_stmt_attr_allowed(kind: SyntaxKind) -> bool { |
66 | match kind { | 53 | match kind { |
67 | BIN_EXPR | RANGE_EXPR | IF_EXPR => false, | 54 | BIN_EXPR | RANGE_EXPR | IF_EXPR => false, |