about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-12-02 07:22:02 +0000
committerbors <bors@rust-lang.org>2014-12-02 07:22:02 +0000
commit8dbe63200d56cfb848e7a58107c93a4f7a48f45c (patch)
tree1cfc1148b51084b5c67960d05f8afeda14c82588 /src/libsyntax/parse
parent8a210af7e56a7ad25310b482c84bdcba0e65666b (diff)
parentd3bbfb48bd44b578d5ad4a14f82d8066e21a008a (diff)
downloadrust-8dbe63200d56cfb848e7a58107c93a4f7a48f45c.tar.gz
rust-8dbe63200d56cfb848e7a58107c93a4f7a48f45c.zip
auto merge of #19427 : scialex/rust/doc-attr-macros, r=sfackler
this allows one to, for example, use #[doc = $macro_var ] in macros.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index fe9c5494517..920bcc3a951 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1648,6 +1648,12 @@ impl<'a> Parser<'a> {
     /// Matches token_lit = LIT_INTEGER | ...
     pub fn lit_from_token(&mut self, tok: &token::Token) -> Lit_ {
         match *tok {
+            token::Interpolated(token::NtExpr(ref v)) => {
+                match v.node {
+                    ExprLit(ref lit) => { lit.node.clone() }
+                    _ => { self.unexpected_last(tok); }
+                }
+            }
             token::Literal(lit, suf) => {
                 let (suffix_illegal, out) = match lit {
                     token::Byte(i) => (true, LitByte(parse::byte_lit(i.as_str()).val0())),