aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r--crates/ra_parser/src/grammar/attributes.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/crates/ra_parser/src/grammar/attributes.rs b/crates/ra_parser/src/grammar/attributes.rs
index 975f0ef2d..f3158ade3 100644
--- a/crates/ra_parser/src/grammar/attributes.rs
+++ b/crates/ra_parser/src/grammar/attributes.rs
@@ -24,8 +24,23 @@ fn attribute(p: &mut Parser, inner: bool) {
24 p.bump(T![!]); 24 p.bump(T![!]);
25 } 25 }
26 26
27 if p.at(T!['[']) { 27 if p.eat(T!['[']) {
28 items::token_tree(p); 28 paths::use_path(p);
29
30 match p.current() {
31 T![=] => {
32 p.bump(T![=]);
33 if expressions::literal(p).is_none() {
34 p.error("expected literal");
35 }
36 }
37 T!['('] | T!['['] | T!['{'] => items::token_tree(p),
38 _ => {}
39 }
40
41 if !p.eat(T![']']) {
42 p.error("expected `]`");
43 }
29 } else { 44 } else {
30 p.error("expected `[`"); 45 p.error("expected `[`");
31 } 46 }