From 359d3be308cab2415218200f5799c5031213c250 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 2 May 2020 14:34:39 +0200 Subject: Fix parsing of blocks without `{` --- crates/ra_parser/src/grammar/expressions.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'crates/ra_parser/src/grammar/expressions.rs') 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 @@ mod atom; -pub(crate) use self::atom::match_arm_list; +pub(crate) use self::atom::{block_expr, match_arm_list}; pub(super) use self::atom::{literal, LITERAL_FIRST}; use super::*; @@ -49,19 +49,6 @@ fn expr_no_struct(p: &mut Parser) { expr_bp(p, r, 1); } -// test block -// fn a() {} -// fn b() { let _ = 1; } -// fn c() { 1; 2; } -// fn d() { 1; 2 } -pub(crate) fn block(p: &mut Parser) { - if !p.at(T!['{']) { - p.error("expected a block"); - return; - } - atom::block_expr(p); -} - fn is_expr_stmt_attr_allowed(kind: SyntaxKind) -> bool { match kind { BIN_EXPR | RANGE_EXPR | IF_EXPR => false, -- cgit v1.2.3