Skip to content

Commit 798da23

Browse files
committed
allow macro expansions in attributes
1 parent 52888a7 commit 798da23

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,12 @@ impl<'a> Parser<'a> {
16691669
/// Matches token_lit = LIT_INTEGER | ...
16701670
pub fn lit_from_token(&mut self, tok: &token::Token) -> Lit_ {
16711671
match *tok {
1672+
token::Interpolated(token::NtExpr(ref v)) => {
1673+
match v.node {
1674+
ExprLit(ref lit) => { lit.node.clone() }
1675+
_ => { self.unexpected_last(tok); }
1676+
}
1677+
}
16721678
token::Literal(lit, suf) => {
16731679
let (suffix_illegal, out) = match lit {
16741680
token::Byte(i) => (true, LitByte(parse::byte_lit(i.as_str()).val0())),

0 commit comments

Comments
 (0)