1
Fork 0

Allow attributes to appear as macro arguments

Fixes #8393
This commit is contained in:
Niko Matsakis 2013-08-08 13:28:06 -04:00
parent 8f65dbfcfa
commit 33c6d3fd78
7 changed files with 137 additions and 59 deletions

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[macro_escape];
use abi;
use abi::AbiSet;
use ast::{Sigil, BorrowedSigil, ManagedSigil, OwnedSigil};
@ -4452,7 +4454,17 @@ impl Parser {
attrs: ~[Attribute],
macros_allowed: bool)
-> item_or_view_item {
maybe_whole!(iovi self, nt_item);
match *self.token {
INTERPOLATED(token::nt_item(item)) => {
self.bump();
let new_attrs = vec::append(attrs, item.attrs);
return iovi_item(@ast::item {
attrs: new_attrs,
..(*item).clone()});
}
_ => {}
}
let lo = self.span.lo;
let visibility = self.parse_non_priv_visibility();