From a3b842fb8b7b5503b1c4fc49355edd4f2fe0d28d Mon Sep 17 00:00:00 2001 From: DJMcNab <36049421+DJMcNab@users.noreply.github.com> Date: Wed, 19 Dec 2018 21:19:32 +0000 Subject: Add tests and only traverse in the crates directory --- crates/ra_syntax/src/grammar/expressions.rs | 8 ++++++-- crates/ra_syntax/src/grammar/expressions/atom.rs | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax/src/grammar') diff --git a/crates/ra_syntax/src/grammar/expressions.rs b/crates/ra_syntax/src/grammar/expressions.rs index 5f5a3077d..4f8c46ab3 100644 --- a/crates/ra_syntax/src/grammar/expressions.rs +++ b/crates/ra_syntax/src/grammar/expressions.rs @@ -73,6 +73,10 @@ pub(crate) fn block(p: &mut Parser) { // for _ in () {} // {} // {} + // macro_rules! test { + // () => {} + // } + // test!{} // } if is_blocklike { p.eat(SEMI); @@ -168,13 +172,13 @@ fn current_op(p: &Parser) -> (u8, Op) { // Parses expression with binding power of at least bp. fn expr_bp(p: &mut Parser, r: Restrictions, bp: u8) -> BlockLike { let mut lhs = match lhs(p, r) { - Some((lhs, macro_blocklike)) => { + Some((lhs, blocklike)) => { // test stmt_bin_expr_ambiguity // fn foo() { // let _ = {1} & 2; // {1} &2; // } - if r.prefer_stmt && macro_blocklike.is_block() { + if r.prefer_stmt && blocklike.is_block() { return BlockLike::Block; } lhs diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs index a976799e7..cd7d62aff 100644 --- a/crates/ra_syntax/src/grammar/expressions/atom.rs +++ b/crates/ra_syntax/src/grammar/expressions/atom.rs @@ -353,6 +353,7 @@ pub(crate) fn match_arm_list(p: &mut Parser) { // fn foo() { // match () { // _ => (), +// _ if Test>{field: 0} => (), // X | Y if Z => (), // | X | Y if Z => (), // | X => (), -- cgit v1.2.3