sp: Span,
tts: &[ast::TokenTree])
-> Box<base::MacResult> {
- let e_refutable = cx.expr_lit(sp, ast::LitBool(true));
- let expanded = expand_parse_call(cx, sp, "parse_pat",
- vec!(e_refutable), tts);
+ let expanded = expand_parse_call(cx, sp, "parse_pat", vec!(), tts);
base::MacExpr::new(expanded)
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// ignore-test
-
#![feature(quote)]
#![feature(managed_boxes)]
use syntax::ext::base::ExtCtxt;
fn syntax_extension(cx: &ExtCtxt) {
- let e_toks : Vec<syntax::ast::token_tree> = quote_tokens!(cx, 1 + 2);
- let p_toks : Vec<syntax::ast::token_tree> = quote_tokens!(cx, (x, 1 .. 4, *));
+ let e_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, 1 + 2);
+ let p_toks : Vec<syntax::ast::TokenTree> = quote_tokens!(cx, (x, 1 .. 4, *));
let a: @syntax::ast::Expr = quote_expr!(cx, 1 + 2);
- let _b: Option<@syntax::ast::item> = quote_item!(cx, static foo : int = $e_toks; );
+ let _b: Option<@syntax::ast::Item> = quote_item!(cx, static foo : int = $e_toks; );
let _c: @syntax::ast::Pat = quote_pat!(cx, (x, 1 .. 4, *) );
let _d: @syntax::ast::Stmt = quote_stmt!(cx, let x = $a; );
let _e: @syntax::ast::Expr = quote_expr!(cx, match foo { $p_toks => 10 } );