@@ -12,7 +12,6 @@ use ast;
12
12
use codemap:: { BytePos , Pos , Span } ;
13
13
use ext:: base:: ExtCtxt ;
14
14
use ext:: base;
15
- use ext:: expand;
16
15
use ext:: build:: AstBuilder ;
17
16
use parse:: token:: * ;
18
17
use parse:: token;
@@ -292,73 +291,53 @@ pub mod rt {
292
291
293
292
pub fn expand_quote_tokens(cx: @ExtCtxt,
294
293
sp: Span,
295
- tts: &[ast::token_tree],
296
- ctxt: ast::SyntaxContext) -> base::MacResult {
294
+ tts: &[ast::token_tree]) -> base::MacResult {
297
295
let (cx_expr, expr) = expand_tts(cx, sp, tts);
298
296
let expanded = expand_wrapper(cx, sp, cx_expr, expr);
299
- // repaint the expanded code so it's as though it was the original text.
300
- let repainted = expand::replace_ctxts(expanded,ctxt);
301
- base::MRExpr(repainted)
297
+ base::MRExpr(expanded)
302
298
}
303
299
304
300
pub fn expand_quote_expr(cx: @ExtCtxt,
305
301
sp: Span,
306
- tts: &[ast::token_tree],
307
- ctxt: ast::SyntaxContext) -> base::MacResult {
302
+ tts: &[ast::token_tree]) -> base::MacResult {
308
303
let expanded = expand_parse_call(cx, sp, " parse_expr", ~[ ] , tts) ;
309
- // repaint the expanded code so it's as though it was the original text.
310
- let repainted = expand:: replace_ctxts ( expanded, ctxt) ;
311
- base:: MRExpr ( repainted)
304
+ base:: MRExpr ( expanded)
312
305
}
313
306
314
- // these probably need to be capturing, too...
315
-
316
307
pub fn expand_quote_item ( cx : @ExtCtxt ,
317
308
sp : Span ,
318
- tts : & [ ast:: token_tree ] ,
319
- ctxt : ast:: SyntaxContext ) -> base:: MacResult {
309
+ tts : & [ ast:: token_tree ] ) -> base:: MacResult {
320
310
let e_attrs = cx. expr_vec_uniq ( sp, ~[ ] ) ;
321
311
let expanded = expand_parse_call ( cx, sp, "parse_item" ,
322
312
~[ e_attrs] , tts) ;
323
- // repaint the expanded code so it's as though it was the original text.
324
- let repainted = expand:: replace_ctxts ( expanded, ctxt) ;
325
- base:: MRExpr ( repainted)
313
+ base:: MRExpr ( expanded)
326
314
}
327
315
328
316
pub fn expand_quote_pat ( cx : @ExtCtxt ,
329
317
sp : Span ,
330
- tts : & [ ast:: token_tree ] ,
331
- ctxt : ast:: SyntaxContext ) -> base:: MacResult {
318
+ tts : & [ ast:: token_tree ] ) -> base:: MacResult {
332
319
let e_refutable = cx. expr_lit ( sp, ast:: lit_bool ( true ) ) ;
333
320
let expanded = expand_parse_call ( cx, sp, "parse_pat" ,
334
321
~[ e_refutable] , tts) ;
335
- // repaint the expanded code so it's as though it was the original text.
336
- let repainted = expand:: replace_ctxts ( expanded, ctxt) ;
337
- base:: MRExpr ( repainted)
322
+ base:: MRExpr ( expanded)
338
323
}
339
324
340
325
pub fn expand_quote_ty ( cx : @ExtCtxt ,
341
326
sp : Span ,
342
- tts : & [ ast:: token_tree ] ,
343
- ctxt : ast:: SyntaxContext ) -> base:: MacResult {
327
+ tts : & [ ast:: token_tree ] ) -> base:: MacResult {
344
328
let e_param_colons = cx. expr_lit ( sp, ast:: lit_bool ( false ) ) ;
345
329
let expanded = expand_parse_call ( cx, sp, "parse_ty" ,
346
330
~[ e_param_colons] , tts) ;
347
- // repaint the expanded code so it's as though it was the original text.
348
- let repainted = expand:: replace_ctxts ( expanded, ctxt) ;
349
- base:: MRExpr ( repainted)
331
+ base:: MRExpr ( expanded)
350
332
}
351
333
352
334
pub fn expand_quote_stmt ( cx : @ExtCtxt ,
353
335
sp : Span ,
354
- tts : & [ ast:: token_tree ] ,
355
- ctxt : ast:: SyntaxContext ) -> base:: MacResult {
336
+ tts : & [ ast:: token_tree ] ) -> base:: MacResult {
356
337
let e_attrs = cx. expr_vec_uniq ( sp, ~[ ] ) ;
357
338
let expanded = expand_parse_call ( cx, sp, "parse_stmt" ,
358
339
~[ e_attrs] , tts) ;
359
- // repaint the expanded code so it's as though it was the original text.
360
- let repainted = expand:: replace_ctxts ( expanded, ctxt) ;
361
- base:: MRExpr ( repainted)
340
+ base:: MRExpr ( expanded)
362
341
}
363
342
364
343
fn ids_ext ( strs : ~[ ~str ] ) -> ~[ ast:: Ident ] {
0 commit comments