aboutsummaryrefslogtreecommitdiff
path: root/printing
diff options
context:
space:
mode:
authorGaëtan Gilbert2020-11-02 15:03:09 +0100
committerGaëtan Gilbert2020-11-02 15:03:09 +0100
commit225a4ee2871b58661f9689255237a1e189ee6a4c (patch)
tree4901f319b8babc4e5bc24e6a3a3d3fa68cb21e35 /printing
parent1280a492b87f02aac8c8f8496ebd42039762d7e4 (diff)
Nicer spacing when printing array literals
From [|x; y; z | def : ty |] to [| x; y; z | def : ty |]
Diffstat (limited to 'printing')
-rw-r--r--printing/ppconstr.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/printing/ppconstr.ml b/printing/ppconstr.ml
index 6f50f34f36..45d0e39ed6 100644
--- a/printing/ppconstr.ml
+++ b/printing/ppconstr.ml
@@ -681,8 +681,9 @@ let tag_var = tag Tag.variable
| CDelimiters (sc,a) ->
return (pr_delimiters sc (pr mt (LevelLe ldelim) a), ldelim)
| CArray(u, t,def,ty) ->
- hov 0 (str "[|" ++ prvect_with_sep (fun () -> str "; ") (pr mt ltop) t ++
- str " |" ++ spc() ++ pr mt ltop def ++ pr_opt_type_spc (pr mt) ty ++
+ hov 0 (str "[| " ++ prvect_with_sep (fun () -> str "; ") (pr mt ltop) t ++
+ (if not (Array.is_empty t) then str " " else mt()) ++
+ str "|" ++ spc() ++ pr mt ltop def ++ pr_opt_type_spc (pr mt) ty ++
str " |]" ++ pr_universe_instance u), 0
in
let loc = constr_loc a in