Consolidate formatting functions a bit more.
This commit is contained in:
parent
55e3cd41de
commit
b6971d94df
7 changed files with 132 additions and 209 deletions
|
|
@ -4642,8 +4642,8 @@ fn trans_lval(&@block_ctxt cx, &@ast::expr e) -> lval_result {
|
|||
}
|
||||
case (_) {
|
||||
cx.fcx.lcx.ccx.sess.span_unimpl(e.span,
|
||||
"expr variant in trans_lval: "
|
||||
+ util::common::expr_to_str(e));
|
||||
"expr variant in trans_lval: "
|
||||
+ pretty::pprust::expr_to_str(e));
|
||||
}
|
||||
}
|
||||
fail;
|
||||
|
|
@ -5784,7 +5784,7 @@ fn trans_log(int lvl, &@block_ctxt cx, &@ast::expr e) -> result {
|
|||
fn trans_check_expr(&@block_ctxt cx, &@ast::expr e) -> result {
|
||||
auto cond_res = trans_expr(cx, e);
|
||||
|
||||
auto expr_str = util::common::expr_to_str(e);
|
||||
auto expr_str = pretty::pprust::expr_to_str(e);
|
||||
auto fail_cx = new_sub_block_ctxt(cx, "fail");
|
||||
auto fail_res = trans_fail(fail_cx, some[common::span](e.span), expr_str);
|
||||
|
||||
|
|
@ -6004,9 +6004,9 @@ fn trans_spawn(&@block_ctxt cx,
|
|||
// Make the task name
|
||||
auto tname = alt(name) {
|
||||
case(none) {
|
||||
auto argss = vec::map(common::expr_to_str, args);
|
||||
auto argss = vec::map(pretty::pprust::expr_to_str, args);
|
||||
#fmt("%s(%s)",
|
||||
common::expr_to_str(func),
|
||||
pretty::pprust::expr_to_str(func),
|
||||
str::connect(argss, ", "))
|
||||
}
|
||||
case(some(?n)) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ import aux::fixed_point_states;
|
|||
import aux::bitv_to_str;
|
||||
import aux::first_difference_string;
|
||||
|
||||
import util::common::ty_to_str;
|
||||
import pretty::pprust::ty_to_str;
|
||||
import util::common::log_stmt_err;
|
||||
import aux::log_bitv_err;
|
||||
import bitvectors::promises;
|
||||
|
|
@ -74,7 +74,7 @@ fn check_states_expr(&fn_ctxt fcx, @expr e) -> () {
|
|||
auto diff = first_difference_string(fcx, prec, pres);
|
||||
s += ("Unsatisfied precondition constraint (for example, "
|
||||
+ diff + ") for expression:\n");
|
||||
s += util::common::expr_to_str(e);
|
||||
s += pretty::pprust::expr_to_str(e);
|
||||
s += ("\nPrecondition:\n");
|
||||
s += bitv_to_str(fcx, prec);
|
||||
s += ("\nPrestate:\n");
|
||||
|
|
@ -102,7 +102,7 @@ fn check_states_stmt(&fn_ctxt fcx, &stmt s) -> () {
|
|||
auto diff = first_difference_string(fcx, prec, pres);
|
||||
ss += ("Unsatisfied precondition constraint (for example, "
|
||||
+ diff + ") for statement:\n");
|
||||
ss += util::common::stmt_to_str(s);
|
||||
ss += pretty::pprust::stmt_to_str(s);
|
||||
ss += ("\nPrecondition:\n");
|
||||
ss += bitv_to_str(fcx, prec);
|
||||
ss += ("\nPrestate: \n");
|
||||
|
|
|
|||
|
|
@ -513,7 +513,9 @@ fn cname(&ctxt cx, &t typ) -> option::t[str] {
|
|||
fn path_to_str(&ast::path pth) -> str {
|
||||
auto result = str::connect(pth.node.idents, "::");
|
||||
if (vec::len[@ast::ty](pth.node.types) > 0u) {
|
||||
auto f = pretty::pprust::ty_to_str;
|
||||
fn f(&@ast::ty t) -> str {
|
||||
ret pretty::pprust::ty_to_str(*t);
|
||||
}
|
||||
result += "[";
|
||||
result += str::connect(vec::map(f, pth.node.types), ",");
|
||||
result += "]";
|
||||
|
|
|
|||
|
|
@ -1517,7 +1517,7 @@ mod pushdown {
|
|||
case (_) {
|
||||
scx.fcx.ccx.tcx.sess.span_unimpl(e.span,
|
||||
#fmt("type unification for expression variant: %s",
|
||||
util::common::expr_to_str(e)));
|
||||
pretty::pprust::expr_to_str(e)));
|
||||
fail;
|
||||
}
|
||||
}
|
||||
|
|
@ -1803,7 +1803,7 @@ fn require_pure_function(@crate_ctxt ccx, &ast::def_id d_id, &span sp) -> () {
|
|||
|
||||
fn check_expr(&@stmt_ctxt scx, &@ast::expr expr) {
|
||||
// scx.fcx.ccx.tcx.sess.span_warn(expr.span, "typechecking expr " +
|
||||
// util::common::expr_to_str(expr));
|
||||
// pretty::pprust::expr_to_str(expr));
|
||||
|
||||
// A generic function to factor out common logic from call and bind
|
||||
// expressions.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue