Switch fmt extension to reference extfmt that's in core.

This commit is contained in:
Graydon Hoare 2011-12-15 16:34:19 -08:00
parent 88818334b7
commit d1bca753b8

View File

@ -96,13 +96,8 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, pieces: [piece], args: [@ast::expr])
let recexpr = ast::expr_rec(astfields, option::none::<@ast::expr>); let recexpr = ast::expr_rec(astfields, option::none::<@ast::expr>);
ret @{id: cx.next_id(), node: recexpr, span: sp}; ret @{id: cx.next_id(), node: recexpr, span: sp};
} }
fn make_path_vec(cx: ext_ctxt, ident: ast::ident) -> [ast::ident] { fn make_path_vec(_cx: ext_ctxt, ident: ast::ident) -> [ast::ident] {
fn compiling_std(cx: ext_ctxt) -> bool { ret ["extfmt", "rt", ident];
ret str::find(cx.crate_file_name(), "std.rc") >= 0;
}
if compiling_std(cx) {
ret ["extfmt", "rt", ident];
} else { ret ["std", "extfmt", "rt", ident]; }
} }
fn make_rt_path_expr(cx: ext_ctxt, sp: span, ident: str) -> @ast::expr { fn make_rt_path_expr(cx: ext_ctxt, sp: span, ident: str) -> @ast::expr {
let path = make_path_vec(cx, ident); let path = make_path_vec(cx, ident);