From 5c82cb42e797599036746461eddf2bec1685eaf3 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 15 Sep 2010 16:10:08 -0700 Subject: Add Ast.ATOM_pexp and -pexp mode wherein pexps live beyond parsing, into later stages. Fixes to pexp pretty printer. --- src/boot/util/fmt.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/boot/util') diff --git a/src/boot/util/fmt.ml b/src/boot/util/fmt.ml index 650224ba..8fa41695 100644 --- a/src/boot/util/fmt.ml +++ b/src/boot/util/fmt.ml @@ -9,11 +9,12 @@ let fmt_str ff = fmt ff "%s" ;; let fmt_obox ff = Format.pp_open_box ff 4;; -let fmt_obox_3 ff = Format.pp_open_box ff 3;; +let fmt_obox_n ff n = Format.pp_open_box ff n;; let fmt_cbox ff = Format.pp_close_box ff ();; let fmt_obr ff = fmt ff "{";; let fmt_cbr ff = fmt ff "@\n}";; let fmt_cbb ff = (fmt_cbox ff; fmt_cbr ff);; +let fmt_break ff = Format.pp_print_space ff ();; let fmt_bracketed (bra:string) @@ -23,7 +24,9 @@ let fmt_bracketed (a:'a) : unit = fmt_str ff bra; + fmt_obox_n ff 0; inner ff a; + fmt_cbox ff; fmt_str ff ket ;; @@ -37,7 +40,7 @@ let fmt_arr_sep begin fun i a -> if i <> 0 - then fmt_str ff sep; + then (fmt_str ff sep; fmt_break ff); inner ff a end az -- cgit v1.2.3