aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_parser/src/grammar/attributes.rs18
-rw-r--r--crates/ra_syntax/src/ast/extensions.rs9
2 files changed, 8 insertions, 19 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![']']) {
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs
index a7b886457..cefc00402 100644
--- a/crates/ra_syntax/src/ast/extensions.rs
+++ b/crates/ra_syntax/src/ast/extensions.rs
@@ -36,15 +36,6 @@ fn text_of_first_token(node: &SyntaxNode) -> &SmolStr {
36} 36}
37 37
38impl ast::Attr { 38impl ast::Attr {
39 pub fn is_inner(&self) -> bool {
40 let prev = match self.syntax().prev_sibling() {
41 None => return false,
42 Some(prev) => prev,
43 };
44
45 prev.kind() == T![!]
46 }
47
48 pub fn as_simple_atom(&self) -> Option<SmolStr> { 39 pub fn as_simple_atom(&self) -> Option<SmolStr> {
49 match self.input() { 40 match self.input() {
50 None => self.simple_name(), 41 None => self.simple_name(),