aboutsummaryrefslogtreecommitdiff
path: root/printing
diff options
context:
space:
mode:
authorGaëtan Gilbert2020-10-12 15:13:15 +0200
committerGaëtan Gilbert2020-11-02 14:56:53 +0100
commit1280a492b87f02aac8c8f8496ebd42039762d7e4 (patch)
treeaee3a393913a8e11b7b82e13cc77ebc3bb437353 /printing
parentdfdecf24210ee287d554cf4296bd0ccfffe310d8 (diff)
Fix printing for empty primitive arrays
Fix #13178
Diffstat (limited to 'printing')
-rw-r--r--printing/ppconstr.ml10
1 files changed, 3 insertions, 7 deletions
diff --git a/printing/ppconstr.ml b/printing/ppconstr.ml
index 8da1d636f0..6f50f34f36 100644
--- a/printing/ppconstr.ml
+++ b/printing/ppconstr.ml
@@ -681,13 +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) ->
- let pp = ref (str " |"++ spc () ++ pr mt ltop def
- ++ pr_opt_type_spc (pr mt) ty ++ str " |]" ++ pr_universe_instance u) in
- for i = Array.length t - 1 downto 1 do
- pp := str ";" ++ pr mt ltop t.(i) ++ !pp
- done;
- pp := pr mt ltop t.(0) ++ !pp;
- hov 0 (str "[|" ++ !pp), 0
+ 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 ++
+ str " |]" ++ pr_universe_instance u), 0
in
let loc = constr_loc a in
pr_with_comments ?loc