aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src
diff options
context:
space:
mode:
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![']']) {