aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar
diff options
context:
space:
mode:
authorAlexander Andreev <[email protected]>2019-09-30 10:07:26 +0100
committerAlexander Andreev <[email protected]>2019-09-30 10:07:26 +0100
commit81efd696ccb369d6c4813bad1107bfd9e270385b (patch)
treef91b652c3ee8e4503c146bf4f76f129fb9ef1428 /crates/ra_parser/src/grammar
parentfdbd6bb11a0c47bf9ba1428e6bd432cd2ce72045 (diff)
parent733f1d8b709788225bd06f8c0aee1819db92620b (diff)
Merge branch 'master' into feature/issue/1856
# Conflicts: # crates/ra_assists/src/ast_editor.rs
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 }