diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-01-10 14:02:36 -0800 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-02 01:44:48 +1100 |
| commit | 8e52b85d5a6f6e3aaa2f15d7c1e907d0ce8589ee (patch) | |
| tree | afcac214c65f792304926a71117ffdf37a0fd060 /src/libsyntax/ext/quote.rs | |
| parent | 70c5a0fbf784d6a89b1c2c50f9fe83093bd21abc (diff) | |
| download | rust-8e52b85d5a6f6e3aaa2f15d7c1e907d0ce8589ee.tar.gz rust-8e52b85d5a6f6e3aaa2f15d7c1e907d0ce8589ee.zip | |
libsyntax: De-`@str` literal strings in the AST
Diffstat (limited to 'src/libsyntax/ext/quote.rs')
| -rw-r--r-- | src/libsyntax/ext/quote.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 6faed270875..425ac8865b2 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -31,6 +31,7 @@ use parse; pub mod rt { use ast; use ext::base::ExtCtxt; + use parse::token; use parse; use print::pprust; @@ -118,7 +119,8 @@ pub mod rt { impl<'a> ToSource for &'a str { fn to_source(&self) -> @str { - let lit = dummy_spanned(ast::LitStr(self.to_managed(), ast::CookedStr)); + let lit = dummy_spanned(ast::LitStr( + token::intern_and_get_ident(*self), ast::CookedStr)); pprust::lit_to_str(&lit).to_managed() } } @@ -349,7 +351,7 @@ fn id_ext(str: &str) -> ast::Ident { // Lift an ident to the expr that evaluates to that ident. fn mk_ident(cx: &ExtCtxt, sp: Span, ident: ast::Ident) -> @ast::Expr { - let e_str = cx.expr_str(sp, cx.str_of(ident)); + let e_str = cx.expr_str(sp, token::get_ident(ident.name)); cx.expr_method_call(sp, cx.expr_ident(sp, id_ext("ext_cx")), id_ext("ident_of"), |
