提交 9d5ec04d 编写于 作者: H Huon Wilson 提交者: Alex Crichton

syntax: fix quote_pat! & unignore a quotation test.

上级 c9f3f477
......@@ -368,9 +368,7 @@ pub fn expand_quote_pat(cx: &mut ExtCtxt,
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)
}
......
......@@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-test
#![feature(quote)]
#![feature(managed_boxes)]
......@@ -18,11 +16,11 @@
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 } );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册