mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
better printing in CCBench
This commit is contained in:
parent
ea6a07ed31
commit
c6072b6b2f
1 changed files with 6 additions and 3 deletions
|
|
@ -109,8 +109,8 @@ let map_int l =
|
||||||
let rec print fmt = function
|
let rec print fmt = function
|
||||||
| Multiple (l, m) ->
|
| Multiple (l, m) ->
|
||||||
Format.fprintf fmt "@[<hv>%a%a@]"
|
Format.fprintf fmt "@[<hv>%a%a@]"
|
||||||
(print_list_ ~sep:"," print) l
|
|
||||||
print_map m
|
print_map m
|
||||||
|
(print_list_ ~sep:"," print) l
|
||||||
| WithInt l ->
|
| WithInt l ->
|
||||||
Format.fprintf fmt "@[<hv>[%a]@]"
|
Format.fprintf fmt "@[<hv>[%a]@]"
|
||||||
(print_list_ print_pair)
|
(print_list_ print_pair)
|
||||||
|
|
@ -119,8 +119,11 @@ let rec print fmt = function
|
||||||
and print_pair fmt (n,t) =
|
and print_pair fmt (n,t) =
|
||||||
Format.fprintf fmt "@[<h>%d: %a@]" n print t
|
Format.fprintf fmt "@[<h>%d: %a@]" n print t
|
||||||
and print_map fmt m =
|
and print_map fmt m =
|
||||||
Format.pp_open_hvbox fmt 0;
|
let first = ref true in
|
||||||
SMap.iter (fun n t -> Format.fprintf fmt "@[%s.%a@]" n print t) m;
|
Format.pp_open_vbox fmt 0;
|
||||||
|
SMap.iter (fun n t ->
|
||||||
|
if !first then first := false else Format.pp_print_cut fmt ();
|
||||||
|
Format.fprintf fmt "@[%s.%a@]" n print t) m;
|
||||||
Format.pp_close_box fmt ()
|
Format.pp_close_box fmt ()
|
||||||
|
|
||||||
(** {2 Path} *)
|
(** {2 Path} *)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue