Commit 832d2771 authored by Andrei Paskevich's avatar Andrei Paskevich
Browse files

revert the definition of Term.t_label

also assure that location printing in Pretty is parenthesized correctly.
parent ff03a398
......@@ -196,25 +196,25 @@ let print_loc fmt l =
fprintf fmt "#\"%s\" %d %d %d#" f l b e
let print_ident_labels fmt id =
if Debug.test_flag debug_print_labels && id.id_label <> []
then fprintf fmt " %a" (print_list space print_label) id.id_label
else ();
if Debug.test_flag debug_print_labels && id.id_label <> [] then
fprintf fmt " %a" (print_list space print_label) id.id_label;
if Debug.test_flag debug_print_locs then
Util.option_iter (fun l -> fprintf fmt " %a" print_loc l) id.id_loc
else ()
Util.option_iter (fprintf fmt " %a" print_loc) id.id_loc
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;
match t.t_label with
| _ when Debug.nottest_flag debug_print_labels
-> print_tnode pri fmt t
| [] -> print_tnode pri fmt t
| ll -> fprintf fmt (protect_on (pri > 0) "%a %a")
(print_list space print_label) ll (print_tnode 0) t
let print_tlab pri fmt t =
if Debug.test_flag debug_print_labels || t.t_label <> []
then fprintf fmt (protect_on (pri > 0) "%a %a")
(print_list space print_label) t.t_label (print_tnode 0) t
else print_tnode pri fmt t in
let print_tloc pri fmt t =
if Debug.test_flag debug_print_locs || t.t_loc <> None
then fprintf fmt (protect_on (pri > 0) "%a %a")
(print_option print_loc) t.t_loc (print_tlab 0) t
else print_tlab pri fmt t in
print_tloc pri fmt t
and print_app pri ls fmt tl = match extract_op ls, tl with
| _, [] ->
......
......@@ -483,10 +483,7 @@ 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 = match loc with None -> t.t_loc | Some _ -> loc }
let t_label ?loc l t = Hsterm.hashcons { t with t_label = l; t_loc = 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