syntax: fix quote_pat! & unignore a quotation test.

This commit is contained in:
Huon Wilson 2014-06-13 09:36:26 +10:00 committed by Alex Crichton
parent c9f3f47702
commit 9d5ec04d18
2 changed files with 4 additions and 8 deletions

View file

@ -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)
}

View file

@ -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 @@ extern crate syntax;
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 } );