aboutsummaryrefslogtreecommitdiff
path: root/printing/ppconstr.ml
diff options
context:
space:
mode:
authorMaxime Dénès2020-02-03 18:19:42 +0100
committerMaxime Dénès2020-07-06 11:22:43 +0200
commit0ea2d0ff4ed84e1cc544c958b8f6e98f6ba2e9b6 (patch)
treefbad060c3c2e29e81751dea414c898b5cb0fa22d /printing/ppconstr.ml
parentcf388fdb679adb88a7e8b3122f65377552d2fb94 (diff)
Primitive persistent arrays
Persistent arrays expose a functional interface but are implemented using an imperative data structure. The OCaml implementation is based on Jean-Christophe Filliâtre's. Co-authored-by: Benjamin Grégoire <Benjamin.Gregoire@inria.fr> Co-authored-by: Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>
Diffstat (limited to 'printing/ppconstr.ml')
-rw-r--r--printing/ppconstr.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/printing/ppconstr.ml b/printing/ppconstr.ml
index b285c0abcc..af105f4d63 100644
--- a/printing/ppconstr.ml
+++ b/printing/ppconstr.ml
@@ -655,6 +655,14 @@ let tag_var = tag Tag.variable
return (pr_prim_token p, prec_of_prim_token p)
| 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
in
let loc = constr_loc a in
pr_with_comments ?loc