Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Feb 3, 2024
1 parent 8593636 commit 154cb5b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/typing/macroContext.ml
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,21 @@ let macro_timer com l =

let typing_timer ctx need_type f =
let t = Timer.timer ["typing"] in
let old = ctx.com.error_ext and oldlocals = ctx.f.locals in
let old = ctx.com.error_ext in
let restore_report_mode = disable_report_mode ctx.com in
(*
disable resumable errors... unless we are in display mode (we want to reach point of completion)
*)
(* if ctx.com.display.dms_kind = DMNone then ctx.com.error <- (fun e -> raise_error e); *) (* TODO: review this... *)
let restore_field_state = TypeloadFunction.save_field_state ctx in
ctx.com.error_ext <- (fun err -> raise_error { err with err_from_macro = true });

let ctx = if need_type && ctx.pass < PTypeField then begin
enter_field_typing_pass ctx.g ("typing_timer",[] (* TODO: ? *));
enter_field_typing_pass ctx.g ("typing_timer",[]);
TyperManager.clone_for_expr ctx
end else
ctx
in
let exit() =
t();
ctx.com.error_ext <- old;
ctx.f.locals <- oldlocals;
restore_field_state ();
restore_report_mode ();
in
try
Expand Down

0 comments on commit 154cb5b

Please sign in to comment.