aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src
diff options
context:
space:
mode:
authoruHOOCCOOHu <[email protected]>2019-09-30 09:09:02 +0100
committeruHOOCCOOHu <[email protected]>2019-09-30 09:17:54 +0100
commitf7e12559cb26b59a9a2ecee4deecaf6fe9100d16 (patch)
treed17395e4c3f7965c5cf9bdd50ef940e52eef1155 /crates/ra_parser/src
parent5a4b4f507e9b90bfe41b451763868cba0a70c392 (diff)
Fixes
Diffstat (limited to 'crates/ra_parser/src')
-rw-r--r--crates/ra_parser/src/grammar/attributes.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/crates/ra_parser/src/grammar/attributes.rs b/crates/ra_parser/src/grammar/attributes.rs
index 72e7717b7..63ca9ca32 100644
--- a/crates/ra_parser/src/grammar/attributes.rs
+++ b/crates/ra_parser/src/grammar/attributes.rs
@@ -25,17 +25,15 @@ fn attribute(p: &mut Parser, inner: bool) {
25 if p.eat(T!['[']) { 25 if p.eat(T!['[']) {
26 paths::use_path(p); 26 paths::use_path(p);
27 27
28 let is_delimiter = |p: &mut Parser| match p.current() { 28 match p.current() {
29 T!['('] | T!['['] | T!['{'] => true, 29 T![=] => {
30 _ => false, 30 p.bump(T![=]);
31 }; 31 if expressions::literal(p).is_none() {
32 32 p.error("expected literal");
33 if p.eat(T![=]) { 33 }
34 if expressions::literal(p).is_none() {
35 p.error("expected literal");
36 } 34 }
37 } else if is_delimiter(p) { 35 T!['('] | T!['['] | T!['{'] => items::token_tree(p),
38 items::token_tree(p); 36 _ => {}
39 } 37 }
40 38
41 if !p.eat(T![']']) { 39 if !p.eat(T![']']) {