Commit ff03a398 authored by MARCHE Claude's avatar MARCHE Claude
Browse files

print_locs works recursively

parent 8d66bf6d
......@@ -204,12 +204,12 @@ let print_ident_labels fmt id =
else ()
let rec print_term fmt t =
let rec print_term fmt t = print_lterm 0 fmt t
and print_lterm pri fmt t =
if Debug.test_flag debug_print_locs then
Util.option_iter (fun l -> fprintf fmt "%a " print_loc l) t.t_loc;
print_lterm 0 fmt t
and print_lterm pri fmt t = match t.t_label with
match t.t_label with
| _ when Debug.nottest_flag debug_print_labels
-> print_tnode pri fmt t
| [] -> print_tnode pri fmt t
......
......@@ -47,6 +47,7 @@ val print_pat : formatter -> pattern -> unit (* pattern *)
val print_term : formatter -> term -> unit (* term *)
val print_label : formatter -> label -> unit
val print_loc : formatter -> Loc.position -> unit
val print_pkind : formatter -> prop_kind -> unit
val print_meta_arg : formatter -> meta_arg -> unit
val print_meta_arg_type : formatter -> meta_arg_type -> unit
......
......@@ -483,7 +483,10 @@ let t_not f = mk_term (Tnot f) None
let t_true = mk_term (Ttrue) None
let t_false = mk_term (Tfalse) None
let t_label ?loc l t = Hsterm.hashcons { t with t_label = l; t_loc = loc }
let t_label ?loc l t =
Hsterm.hashcons
{ t with t_label = l;
t_loc = match loc with None -> t.t_loc | Some _ -> loc }
let t_label_add l t = Hsterm.hashcons { t with t_label = l :: t.t_label }
let t_label_copy { t_label = l; t_loc = p } t =
......
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