aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dev/db1
-rw-r--r--dev/top_printers.ml15
2 files changed, 15 insertions, 1 deletions
diff --git a/dev/db b/dev/db
index 77dc3eb60..ca5c27de3 100644
--- a/dev/db
+++ b/dev/db
@@ -3,6 +3,7 @@ load_printer "printers.cma"
install_printer Top_printers.ppid
install_printer Top_printers.ppidset
+install_printer Top_printers.ppevarsubst
install_printer Top_printers.ppintset
install_printer Top_printers.pplab
install_printer Top_printers.ppmsid
diff --git a/dev/top_printers.ml b/dev/top_printers.ml
index e64b86a81..d1893005d 100644
--- a/dev/top_printers.ml
+++ b/dev/top_printers.ml
@@ -64,10 +64,23 @@ let ppfconstr c = ppconstr (Closure.term_of_fconstr c)
let ppbigint n = pp (Bigint.pr_bigint n);;
-let prset pr l = str "[" ++ prlist_with_sep spc pr l ++ str "]"
+let prset pr l = str "[" ++ hov 0 (prlist_with_sep spc pr l) ++ str "]"
let ppintset l = pp (prset int (Intset.elements l))
let ppidset l = pp (prset pr_id (Idset.elements l))
+let prset' pr l = str "[" ++ hov 0 (prlist_with_sep pr_coma pr l) ++ str "]"
+let ppidmap pr l =
+ let pr (id,b) = pr_id id ++ str "=>" ++ pr id b in
+ pp (prset' pr (Idmap.fold (fun a b l -> (a,b)::l) l []))
+
+let ppevarsubst = ppidmap (fun id0 -> prset (fun (c,copt,id) ->
+ hov 0
+ (Termops.print_constr c ++
+ (match copt with None -> mt () | Some c -> spc () ++ str "<expanded: " ++
+ Termops.print_constr c ++ str">") ++
+ (if id = id0 then mt ()
+ else spc () ++ str "<canonical: " ++ pr_id id ++ str ">"))))
+
let pP s = pp (hov 0 s)
let safe_pr_global = function