From 5a23af520ddd3dedd9d5c4d7aeab5c5d6f2a7a4f Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Thu, 15 May 2014 16:17:47 +0100 Subject: Group definitions This is only a first step towards sensible spacing. As it turns out, I use too many breaks (hidden in ^/^) instead of separate space [...] for instance. --- src/pretty_print.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pretty_print.ml b/src/pretty_print.ml index 82a877a9..9d435e1d 100644 --- a/src/pretty_print.ml +++ b/src/pretty_print.ml @@ -1272,7 +1272,7 @@ let doc_scattered (SD_aux (sdef, _)) = match sdef with string "member" ^/^ doc_type_union tu | SD_scattered_end id -> string "end" ^/^ doc_id id -let doc_def = function +let doc_def def = group (match def with | DEF_default df -> doc_default df | DEF_spec v_spec -> doc_spec v_spec | DEF_type t_def -> doc_typdef t_def @@ -1280,6 +1280,7 @@ let doc_def = function | DEF_val lbind -> doc_let lbind | DEF_reg_dec dec -> doc_dec dec | DEF_scattered sdef -> doc_scattered sdef + ) let doc_defs (Defs(defs)) = separate_map hardline doc_def defs -- cgit v1.2.3