Commit a023197b by Kim Nguyễn

Add the possibility to enable all debugging code with the debug symbol "all".

Fix conditionaly compiled code, that contained type errors.
parent c9debef5
......@@ -61,7 +61,7 @@ EXTEND Caml_syntax.Gram
None -> ""
| Some s -> s
in
if !debug && (flag = "" || List.mem flag !debug_symbols) then
if !debug && (flag = "" || List.exists (fun s -> s = "all" || s = flag) !debug_symbols) then
e
else <:expr< () >>
]
......
......@@ -319,7 +319,7 @@ let rec norm delta mem t =
V.(get (proj t))
in
DEBUG normrec
(Format.eprintf "@[ - After %s constraints: %a @]@\n"
(Format.eprintf "@[ - After %a constraints: %a @]@\n"
pp_type_kind V.kind ConstrSet.print res);
res
in
......@@ -691,7 +691,7 @@ exception FoundApply of t * int * int * Descr.t Var.Map.map list
let apply_raw delta s t =
DEBUG apply_raw (Format.eprintf " @[Entering apply_raw (delta:@[%a@], @[%a@], @[%a@])@\n%!"
Var.Set.pp delta
Var.Set.print delta
Print.pp_type s
Print.pp_type t
);
......@@ -738,11 +738,11 @@ let apply_raw delta s t =
loop (i+1)
with FoundApply (res, i, j, sl) ->
DEBUG apply_raw (Format.eprintf " Leaving apply_raw (delta:@[%a@], @[%a@], @[%a@]) = @[%a@], @[%a@] @]@\n%!"
Var.Set.pp delta
Var.Set.print delta
Print.pp_type s
Print.pp_type t
Print.pp_type res
ConstrSet.printl sl
pp_sl sl
);
(sl, get ai i, get aj j, res)
in
......
......@@ -3243,7 +3243,7 @@ struct
let _tlv,pos, neg, all = Variable.collect_vars t in
DEBUG clean_type (Format.eprintf " - for type %a pos: %a, neg: %a, all: %a, tlv: %a@\n"
Print.pp_type t
Var.Set.pp pos Var.Set.pp neg Var.Set.pp all Var.Set.pp _tlv);
Var.Set.print pos Var.Set.print neg Var.Set.print all Var.Set.print _tlv);
let vars = Var.Set.diff all delta in
if Var.Set.is_empty vars then t else
let subst = Map.init
......@@ -3259,7 +3259,7 @@ struct
let clean_type delta t =
let res = clean_type delta t in
DEBUG clean_type (Format.eprintf "@[ Calling clean_type(%a,@, %a) = %a@]@\n%!"
Var.Set.pp delta Print.pp_type t Print.pp_type res);
Var.Set.print delta Print.pp_type t Print.pp_type res);
res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment