From ab0a11b1de3237a476639fee39fcf6ef506bdf34 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 16 Jan 2020 18:35:03 +0100 Subject: Simplify array parsing --- crates/ra_parser/src/grammar/attributes.rs | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'crates/ra_parser/src/grammar/attributes.rs') diff --git a/crates/ra_parser/src/grammar/attributes.rs b/crates/ra_parser/src/grammar/attributes.rs index eeae37aef..f3158ade3 100644 --- a/crates/ra_parser/src/grammar/attributes.rs +++ b/crates/ra_parser/src/grammar/attributes.rs @@ -8,28 +8,6 @@ pub(super) fn inner_attributes(p: &mut Parser) { } } -pub(super) fn with_outer_attributes( - p: &mut Parser, - f: impl Fn(&mut Parser) -> Option, -) -> bool { - let am = p.start(); - let has_attrs = p.at(T![#]); - attributes::outer_attributes(p); - let cm = f(p); - let success = cm.is_some(); - - match (has_attrs, cm) { - (true, Some(cm)) => { - let kind = cm.kind(); - cm.undo_completion(p).abandon(p); - am.complete(p, kind); - } - _ => am.abandon(p), - } - - success -} - pub(super) fn outer_attributes(p: &mut Parser) { while p.at(T![#]) { attribute(p, false) -- cgit v1.2.3