2012-02-10 12:28:43 -06:00
|
|
|
// xfail-pretty
|
|
|
|
|
|
|
|
use std;
|
2012-05-29 23:35:12 -05:00
|
|
|
use syntax;
|
2012-02-10 12:28:43 -06:00
|
|
|
|
|
|
|
import std::io::*;
|
|
|
|
|
2012-04-24 15:30:00 -05:00
|
|
|
import syntax::diagnostic;
|
|
|
|
import syntax::ast;
|
|
|
|
import syntax::codemap;
|
|
|
|
import syntax::parse::parser;
|
|
|
|
import syntax::print::*;
|
2012-02-10 12:28:43 -06:00
|
|
|
|
|
|
|
fn new_parse_sess() -> parser::parse_sess {
|
|
|
|
fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
iface fake_ext_ctxt {
|
|
|
|
fn session() -> fake_session;
|
|
|
|
}
|
|
|
|
|
|
|
|
type fake_options = {cfg: ast::crate_cfg};
|
|
|
|
|
|
|
|
type fake_session = {opts: @fake_options,
|
|
|
|
parse_sess: parser::parse_sess};
|
|
|
|
|
|
|
|
impl of fake_ext_ctxt for fake_session {
|
|
|
|
fn session() -> fake_session {self}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn mk_ctxt() -> fake_ext_ctxt {
|
2012-06-25 22:00:46 -05:00
|
|
|
let opts : fake_options = {cfg: []/~};
|
2012-02-10 12:28:43 -06:00
|
|
|
{opts: @opts, parse_sess: new_parse_sess()} as fake_ext_ctxt
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let ext_cx = mk_ctxt();
|
|
|
|
|
2012-02-10 14:22:15 -06:00
|
|
|
let stmt = #ast(stmt){let x int = 20;}; //! ERROR expected end-of-string
|
|
|
|
check_pp(*stmt, pprust::print_stmt, "");
|
2012-02-10 12:28:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn check_pp<T>(expr: T, f: fn(pprust::ps, T), expect: str) {
|
|
|
|
fail;
|
|
|
|
}
|
|
|
|
|