mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2026-01-28 20:04:51 -05:00
small bugfix in CCSexpM.print
This commit is contained in:
parent
92510d2c70
commit
164d71380a
1 changed files with 2 additions and 4 deletions
|
|
@ -93,13 +93,11 @@ let rec print fmt t = match t with
|
||||||
| `List [] -> Format.pp_print_string fmt "()"
|
| `List [] -> Format.pp_print_string fmt "()"
|
||||||
| `List [x] -> Format.fprintf fmt "@[<hov2>(%a)@]" print x
|
| `List [x] -> Format.fprintf fmt "@[<hov2>(%a)@]" print x
|
||||||
| `List l ->
|
| `List l ->
|
||||||
Format.open_hovbox 2;
|
Format.fprintf fmt "@[<hov2>(";
|
||||||
Format.pp_print_char fmt '(';
|
|
||||||
List.iteri
|
List.iteri
|
||||||
(fun i t' -> (if i > 0 then Format.fprintf fmt "@ "; print fmt t'))
|
(fun i t' -> (if i > 0 then Format.fprintf fmt "@ "; print fmt t'))
|
||||||
l;
|
l;
|
||||||
Format.pp_print_char fmt ')';
|
Format.fprintf fmt ")@]"
|
||||||
Format.close_box ()
|
|
||||||
|
|
||||||
let rec print_noindent fmt t = match t with
|
let rec print_noindent fmt t = match t with
|
||||||
| `Atom s when _must_escape s -> Format.fprintf fmt "\"%s\"" (String.escaped s)
|
| `Atom s when _must_escape s -> Format.fprintf fmt "\"%s\"" (String.escaped s)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue