Skip to content

Commit

Permalink
minor changes in pass debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Feb 19, 2015
1 parent 5ed318d commit 39d9182
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ let rec flush_pass ctx p (where:string) =

let make_pass ctx f = f

let init_class_done ctx =
ctx.pass <- PTypeField

let exc_protect ctx f (where:string) =
let rec r = ref (fun() ->
try
Expand Down Expand Up @@ -411,6 +414,10 @@ let context_ident ctx =
let debug ctx str =
if Common.raw_defined ctx.com "cdebug" then prerr_endline (context_ident ctx ^ !delay_tabs ^ str)
let init_class_done ctx =
debug ctx ("init_class_done " ^ Ast.s_type_path ctx.curclass.cl_path);
init_class_done ctx
let ctx_pos ctx =
let inf = Ast.s_type_path ctx.m.curmod.m_path in
let inf = (match snd ctx.curclass.cl_path with "" -> inf | n when n = snd ctx.m.curmod.m_path -> inf | n -> inf ^ "." ^ n) in
Expand Down
2 changes: 1 addition & 1 deletion typeload.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,7 @@ let init_class ctx c p context_init herits fields =
| _ -> ());
(* push delays in reverse order so they will be run in correct order *)
List.iter (fun (ctx,r) ->
ctx.pass <- PTypeField;
init_class_done ctx;
(match r with
| None -> ()
| Some r -> delay ctx PTypeField (fun() -> ignore((!r)())))
Expand Down
2 changes: 1 addition & 1 deletion typer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ let eval ctx s =
| Some path -> path
in
ignore(Typeload.type_module ctx path_module "eval" decls p);
flush_pass ctx PBuildClass "load_module"
flush_pass ctx PBuildClass "eval"

let parse_expr_string ctx s p inl =
let head = "class X{static function main() " in
Expand Down

0 comments on commit 39d9182

Please sign in to comment.