提交 0ddb66c4 编写于 作者: J Jeffrey Seyfried

Allow `IdentMacroExpander::expand` to access the ident macro invocation's attributes.

上级 21ba8160
......@@ -177,7 +177,8 @@ fn expand<'cx>(&self,
cx: &'cx mut ExtCtxt,
sp: Span,
ident: ast::Ident,
token_tree: Vec<tokenstream::TokenTree> )
token_tree: Vec<tokenstream::TokenTree>,
attrs: Vec<ast::Attribute>)
-> Box<MacResult+'cx>;
}
......@@ -193,7 +194,8 @@ fn expand<'cx>(&self,
cx: &'cx mut ExtCtxt,
sp: Span,
ident: ast::Ident,
token_tree: Vec<tokenstream::TokenTree> )
token_tree: Vec<tokenstream::TokenTree>,
_attrs: Vec<ast::Attribute>)
-> Box<MacResult+'cx>
{
(*self)(cx, sp, ident, token_tree)
......
......@@ -374,7 +374,7 @@ fn expand_bang_invoc(&mut self, invoc: Invocation, ext: Rc<SyntaxExtension>) ->
}
});
kind.make_from(expander.expand(self.cx, span, ident, marked_tts))
kind.make_from(expander.expand(self.cx, span, ident, marked_tts, attrs))
}
MacroRulesTT => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册