Fixed bug in typeck that wasn't filling in anns for stmts
(needed for typestate_check). Also changed a (log; fail) to (log_err; fail) in typestate_check, and added some more logging funs in util.common.
This commit is contained in:
parent
0190ebfe07
commit
707cd0281d
3 changed files with 39 additions and 8 deletions
|
|
@ -16,6 +16,7 @@ import std.io.string_writer;
|
|||
import pretty.pprust.print_block;
|
||||
import pretty.pprust.print_expr;
|
||||
import pretty.pprust.print_decl;
|
||||
import pretty.pprust.print_fn;
|
||||
import pretty.pp.mkstate;
|
||||
|
||||
type filename = str;
|
||||
|
|
@ -169,6 +170,25 @@ fn log_ann(&ast.ann a) -> () {
|
|||
}
|
||||
}
|
||||
|
||||
fn fun_to_str(&ast._fn f, str name, vec[ast.ty_param] params) -> str {
|
||||
let str_writer s = string_writer();
|
||||
auto out_ = mkstate(s.get_writer(), 80u);
|
||||
auto out = @rec(s=out_,
|
||||
comments=none[vec[front.lexer.cmnt]],
|
||||
mutable cur_cmnt=0u);
|
||||
|
||||
print_fn(out, f.decl, name, params);
|
||||
ret s.get_str();
|
||||
}
|
||||
|
||||
fn log_fn(&ast._fn f, str name, vec[ast.ty_param] params) -> () {
|
||||
log(fun_to_str(f, name, params));
|
||||
}
|
||||
|
||||
fn log_fn_err(&ast._fn f, str name, vec[ast.ty_param] params) -> () {
|
||||
log_err(fun_to_str(f, name, params));
|
||||
}
|
||||
|
||||
fn stmt_to_str(&ast.stmt st) -> str {
|
||||
let str_writer s = string_writer();
|
||||
auto out_ = mkstate(s.get_writer(), 80u);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue