@@ -19,7 +19,7 @@ use token::*;
19
19
*
20
20
* Quasiquoting works via token trees.
21
21
*
22
- * This is registered as a expression syntax extension called quote! that lifts
22
+ * This is registered as a set of expression syntax extension called quote! that lifts
23
23
* its argument token-tree to an AST representing the construction of the same
24
24
* token tree, with ast::tt_nonterminal nodes interpreted as antiquotes
25
25
* (splices).
@@ -146,16 +146,12 @@ fn mk_span(cx: ext_ctxt, qsp: span, sp: span) -> @ast::expr {
146
146
}
147
147
148
148
// Lift an ident to the expr that evaluates to that ident.
149
- //
150
- // NB: this identifies the interner used when re-parsing the token tree
151
- // with the interner used during initial parse. This is _wrong_ and we
152
- // should be emitting a &str here and the token type should be ok with
153
- // &static/str or &session/str. Longer-term issue.
154
149
fn mk_ident ( cx : ext_ctxt , sp : span , ident : ast:: ident ) -> @ast:: expr {
155
- build:: mk_struct_e ( cx, sp,
156
- ids_ext ( cx, ~[ ~"ident"] ) ,
157
- ~[ { ident: id_ext ( cx, ~"repr") ,
158
- ex: build:: mk_uint ( cx, sp, ident. repr ) } ] )
150
+ let e_meth = build:: mk_access ( cx, sp,
151
+ ids_ext ( cx, ~[ ~"ext_cx"] ) ,
152
+ id_ext ( cx, ~"ident_of") ) ;
153
+ let e_str = build:: mk_uniq_str ( cx, sp, cx. str_of ( ident) ) ;
154
+ build:: mk_call_ ( cx, sp, e_meth, ~[ e_str] )
159
155
}
160
156
161
157
fn mk_bytepos ( cx : ext_ctxt , sp : span , bpos : BytePos ) -> @ast:: expr {
0 commit comments