From 96e3ac389fbc3709cc6e7e8dbe25619daeb61f4b Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Sun, 17 Feb 2019 19:48:08 +0200 Subject: Parse only outer_attributes for match arms for now --- crates/ra_syntax/src/grammar/attributes.rs | 10 ---------- crates/ra_syntax/src/grammar/expressions/atom.rs | 7 +------ 2 files changed, 1 insertion(+), 16 deletions(-) (limited to 'crates/ra_syntax/src') diff --git a/crates/ra_syntax/src/grammar/attributes.rs b/crates/ra_syntax/src/grammar/attributes.rs index 2624d2e16..cd30e8a45 100644 --- a/crates/ra_syntax/src/grammar/attributes.rs +++ b/crates/ra_syntax/src/grammar/attributes.rs @@ -1,15 +1,5 @@ use super::*; -/// Parses both inner & outer attributes. -/// -/// Allowing to run validation for reporting errors -/// regarding attributes -pub(super) fn all_attributes(p: &mut Parser) { - while p.at(POUND) { - attribute(p, p.nth(1) == EXCL) - } -} - pub(super) fn inner_attributes(p: &mut Parser) { while p.current() == POUND && p.nth(1) == EXCL { attribute(p, true) diff --git a/crates/ra_syntax/src/grammar/expressions/atom.rs b/crates/ra_syntax/src/grammar/expressions/atom.rs index 67cd7e6b0..e74305b6a 100644 --- a/crates/ra_syntax/src/grammar/expressions/atom.rs +++ b/crates/ra_syntax/src/grammar/expressions/atom.rs @@ -331,11 +331,6 @@ pub(crate) fn match_arm_list(p: &mut Parser) { continue; } - // This may result in invalid attributes - // if there are inner attributes mixed in together - // with the outer attributes, but we allow parsing - // those so we can run validation and report better errors - // test match_arms_outer_attributes // fn foo() { // match () { @@ -349,7 +344,7 @@ pub(crate) fn match_arm_list(p: &mut Parser) { // _ => (), // } // } - attributes::all_attributes(p); + attributes::outer_attributes(p); // test match_arms_commas // fn foo() { -- cgit v1.2.3