]> git.lizzy.rs Git - rust.git/commitdiff
syntax: fix quote_pat! & unignore a quotation test.
authorHuon Wilson <dbau.pp+github@gmail.com>
Thu, 12 Jun 2014 23:36:26 +0000 (09:36 +1000)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 13 Jun 2014 20:53:55 +0000 (13:53 -0700)
src/libsyntax/ext/quote.rs
src/test/run-pass-fulldeps/quote-tokens.rs

index 185924f704cdde120bff5f723fcd79120def3821..bc5442a94fb7fd69b5b108e82349e93230cc3e6b 100644 (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)
 }
 
index 7c25246807d57a514036611f33e61955adf2c4b1..c41ec0dbd658e869029be25a767a3045a8df7782 100644 (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)]
 
 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 } );