From f27cda6865fa33670a2e364388ecc56285feae30 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 25 Sep 2021 14:24:08 +0300 Subject: [PATCH] minor: more condensed tests --- crates/parser/src/grammar/expressions.rs | 18 ++-- .../ok/0070_stmt_bin_expr_ambiguity.rast | 90 +++++++++---------- .../inline/ok/0070_stmt_bin_expr_ambiguity.rs | 2 +- .../parser/inline/ok/0146_as_precedence.rast | 80 ++++++++--------- .../parser/inline/ok/0146_as_precedence.rs | 4 +- .../ok/0158_binop_resets_statementness.rast | 68 +++++++------- .../ok/0158_binop_resets_statementness.rs | 4 +- 7 files changed, 129 insertions(+), 137 deletions(-) diff --git a/crates/parser/src/grammar/expressions.rs b/crates/parser/src/grammar/expressions.rs index 2bec8577f0c..ba64f58e6dc 100644 --- a/crates/parser/src/grammar/expressions.rs +++ b/crates/parser/src/grammar/expressions.rs @@ -243,12 +243,12 @@ fn current_op(p: &Parser) -> (u8, SyntaxKind) { fn expr_bp(p: &mut Parser, mut r: Restrictions, bp: u8) -> (Option, BlockLike) { let mut lhs = match lhs(p, r) { Some((lhs, blocklike)) => { - // test stmt_bin_expr_ambiguity - // fn foo() { - // let _ = {1} & 2; - // {1} &2; - // } if r.prefer_stmt && blocklike.is_block() { + // test stmt_bin_expr_ambiguity + // fn f() { + // let _ = {1} & 2; + // {1} &2; + // } return (Some(lhs), BlockLike::Block); } lhs @@ -263,9 +263,7 @@ fn expr_bp(p: &mut Parser, mut r: Restrictions, bp: u8) -> (Option (Option