aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/attributes.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-01-16 17:35:03 +0000
committerAleksey Kladov <[email protected]>2020-01-16 17:35:03 +0000
commitab0a11b1de3237a476639fee39fcf6ef506bdf34 (patch)
treed02418aa8a96b7df2703ed379f96310f7f4441b9 /crates/ra_parser/src/grammar/attributes.rs
parentd3c4fbbbc45afc7d480185493b5ce77b5daa1747 (diff)
Simplify array parsing
Diffstat (limited to 'crates/ra_parser/src/grammar/attributes.rs')
-rw-r--r--crates/ra_parser/src/grammar/attributes.rs22
1 files changed, 0 insertions, 22 deletions
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) {
8 } 8 }
9} 9}
10 10
11pub(super) fn with_outer_attributes(
12 p: &mut Parser,
13 f: impl Fn(&mut Parser) -> Option<CompletedMarker>,
14) -> bool {
15 let am = p.start();
16 let has_attrs = p.at(T![#]);
17 attributes::outer_attributes(p);
18 let cm = f(p);
19 let success = cm.is_some();
20
21 match (has_attrs, cm) {
22 (true, Some(cm)) => {
23 let kind = cm.kind();
24 cm.undo_completion(p).abandon(p);
25 am.complete(p, kind);
26 }
27 _ => am.abandon(p),
28 }
29
30 success
31}
32
33pub(super) fn outer_attributes(p: &mut Parser) { 11pub(super) fn outer_attributes(p: &mut Parser) {
34 while p.at(T![#]) { 12 while p.at(T![#]) {
35 attribute(p, false) 13 attribute(p, false)