1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // ignore-test Can't use syntax crate here
17 use syntax::diagnostic;
20 use syntax::parse::parser;
24 fn cfg() -> ast::CrateConfig;
25 fn parse_sess() -> parse::parse_sess;
26 fn call_site() -> span;
27 fn ident_of(st: &str) -> ast::ident;
30 type fake_session = parse::parse_sess;
32 impl fake_ext_ctxt for fake_session {
33 fn cfg() -> ast::CrateConfig { Vec::new() }
34 fn parse_sess() -> parse::parse_sess { self }
35 fn call_site() -> span {
37 lo: codemap::BytePos(0),
38 hi: codemap::BytePos(0),
39 expn_id: codemap::NO_EXPANSION
42 fn ident_of(st: &str) -> ast::ident {
43 self.interner.intern(st)
47 fn mk_ctxt() -> fake_ext_ctxt {
48 parse::new_parse_sess(None) as fake_ext_ctxt
55 let stmt = quote_stmt!(cx, let x int = 20;); //~ ERROR expected end-of-string
56 check_pp(*stmt, pprust::print_stmt, "");
59 fn check_pp<T>(expr: T, f: |pprust::ps, T|, expect: str) {