diff options
author | Aleksey Kladov <[email protected]> | 2019-02-11 16:23:13 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-02-11 16:24:13 +0000 |
commit | 2efdf41bdb178ebf1ff0f8e3b335f491c84d7fa3 (patch) | |
tree | 477852488ac98984574e11e068e911cc8d7aabd2 /crates/ra_syntax/src | |
parent | e7b370226c9b3d045a805dae5b93231a0869bbca (diff) |
make macro a NameOwner
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 1 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 5 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar/items.rs | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 256277609..d2b080743 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -1908,6 +1908,7 @@ impl ToOwned for MacroCall { | |||
1908 | } | 1908 | } |
1909 | 1909 | ||
1910 | 1910 | ||
1911 | impl ast::NameOwner for MacroCall {} | ||
1911 | impl MacroCall { | 1912 | impl MacroCall { |
1912 | pub fn token_tree(&self) -> Option<&TokenTree> { | 1913 | pub fn token_tree(&self) -> Option<&TokenTree> { |
1913 | super::child_opt(self) | 1914 | super::child_opt(self) |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index d428bc595..2e4b2d776 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -545,7 +545,10 @@ Grammar( | |||
545 | "Visibility": (), | 545 | "Visibility": (), |
546 | "Name": (), | 546 | "Name": (), |
547 | "NameRef": (), | 547 | "NameRef": (), |
548 | "MacroCall": ( options: [ "TokenTree", "Path" ] ), | 548 | "MacroCall": ( |
549 | traits: [ "NameOwner" ], | ||
550 | options: [ "TokenTree", "Path" ], | ||
551 | ), | ||
549 | "Attr": ( options: [ ["value", "TokenTree"] ] ), | 552 | "Attr": ( options: [ ["value", "TokenTree"] ] ), |
550 | "TokenTree": (), | 553 | "TokenTree": (), |
551 | "TypeParamList": ( | 554 | "TypeParamList": ( |
diff --git a/crates/ra_syntax/src/grammar/items.rs b/crates/ra_syntax/src/grammar/items.rs index a61f260cf..4b962c1f3 100644 --- a/crates/ra_syntax/src/grammar/items.rs +++ b/crates/ra_syntax/src/grammar/items.rs | |||
@@ -347,7 +347,9 @@ fn macro_call(p: &mut Parser) -> BlockLike { | |||
347 | 347 | ||
348 | pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike { | 348 | pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike { |
349 | p.expect(EXCL); | 349 | p.expect(EXCL); |
350 | p.eat(IDENT); | 350 | if p.at(IDENT) { |
351 | name(p); | ||
352 | } | ||
351 | match p.current() { | 353 | match p.current() { |
352 | L_CURLY => { | 354 | L_CURLY => { |
353 | token_tree(p); | 355 | token_tree(p); |