make macro a NameOwner
This commit is contained in:
@@ -1908,6 +1908,7 @@ impl ToOwned for MacroCall {
|
||||
}
|
||||
|
||||
|
||||
impl ast::NameOwner for MacroCall {}
|
||||
impl MacroCall {
|
||||
pub fn token_tree(&self) -> Option<&TokenTree> {
|
||||
super::child_opt(self)
|
||||
|
||||
@@ -545,7 +545,10 @@ Grammar(
|
||||
"Visibility": (),
|
||||
"Name": (),
|
||||
"NameRef": (),
|
||||
"MacroCall": ( options: [ "TokenTree", "Path" ] ),
|
||||
"MacroCall": (
|
||||
traits: [ "NameOwner" ],
|
||||
options: [ "TokenTree", "Path" ],
|
||||
),
|
||||
"Attr": ( options: [ ["value", "TokenTree"] ] ),
|
||||
"TokenTree": (),
|
||||
"TypeParamList": (
|
||||
|
||||
@@ -347,7 +347,9 @@ fn macro_call(p: &mut Parser) -> BlockLike {
|
||||
|
||||
pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike {
|
||||
p.expect(EXCL);
|
||||
p.eat(IDENT);
|
||||
if p.at(IDENT) {
|
||||
name(p);
|
||||
}
|
||||
match p.current() {
|
||||
L_CURLY => {
|
||||
token_tree(p);
|
||||
|
||||
Reference in New Issue
Block a user