|
16 | 16 | extern crate syntax;
|
17 | 17 |
|
18 | 18 | use syntax::ext::base::ExtCtxt;
|
19 |
| -use std::gc::Gc; |
| 19 | +use syntax::ptr::P; |
20 | 20 |
|
21 | 21 | fn syntax_extension(cx: &ExtCtxt) {
|
22 | 22 | let e_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, 1 + 2);
|
23 | 23 | let p_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, (x, 1 .. 4, *));
|
24 | 24 |
|
25 |
| - let a: Gc<syntax::ast::Expr> = quote_expr!(cx, 1 + 2); |
26 |
| - let _b: Option<Gc<syntax::ast::Item>> = quote_item!(cx, static foo : int = $e_toks; ); |
27 |
| - let _c: Gc<syntax::ast::Pat> = quote_pat!(cx, (x, 1 .. 4, *) ); |
28 |
| - let _d: Gc<syntax::ast::Stmt> = quote_stmt!(cx, let x = $a; ); |
| 25 | + let a: P<syntax::ast::Expr> = quote_expr!(cx, 1 + 2); |
| 26 | + let _b: Option<P<syntax::ast::Item>> = quote_item!(cx, static foo : int = $e_toks; ); |
| 27 | + let _c: P<syntax::ast::Pat> = quote_pat!(cx, (x, 1 .. 4, *) ); |
| 28 | + let _d: P<syntax::ast::Stmt> = quote_stmt!(cx, let x = $a; ); |
29 | 29 | let _d: syntax::ast::Arm = quote_arm!(cx, (ref x, ref y) = (x, y) );
|
30 |
| - let _e: Gc<syntax::ast::Expr> = quote_expr!(cx, match foo { $p_toks => 10 } ); |
| 30 | + let _e: P<syntax::ast::Expr> = quote_expr!(cx, match foo { $p_toks => 10 } ); |
31 | 31 |
|
32 |
| - let _f: Gc<syntax::ast::Expr> = quote_expr!(cx, ()); |
33 |
| - let _g: Gc<syntax::ast::Expr> = quote_expr!(cx, true); |
34 |
| - let _h: Gc<syntax::ast::Expr> = quote_expr!(cx, 'a'); |
| 32 | + let _f: P<syntax::ast::Expr> = quote_expr!(cx, ()); |
| 33 | + let _g: P<syntax::ast::Expr> = quote_expr!(cx, true); |
| 34 | + let _h: P<syntax::ast::Expr> = quote_expr!(cx, 'a'); |
35 | 35 |
|
36 |
| - let i: Option<Gc<syntax::ast::Item>> = quote_item!(cx, #[deriving(Eq)] struct Foo; ); |
| 36 | + let i: Option<P<syntax::ast::Item>> = quote_item!(cx, #[deriving(Eq)] struct Foo; ); |
37 | 37 | assert!(i.is_some());
|
38 | 38 | }
|
39 | 39 |
|
|
0 commit comments