aboutsummaryrefslogtreecommitdiff
path: root/printing
diff options
context:
space:
mode:
authorMatthieu Sozeau2014-06-04 17:18:58 +0200
committerMatthieu Sozeau2014-06-04 17:18:58 +0200
commitdbada2989e334756971c7bf69578c93b2e45643e (patch)
tree9ee0e5de226b95f7ac0795ee1018e666a27fc897 /printing
parent332f092e3a30f8428b28f12c85c0a90e3f6d7171 (diff)
- Better parsing and printing of named universes: Type{ident} and foo@{(ident|Prop|Set|Type|' ')*}
(user given names are still write only). - Add test-suite file for named universes.
Diffstat (limited to 'printing')
-rw-r--r--printing/ppconstr.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/printing/ppconstr.ml b/printing/ppconstr.ml
index 5b6c072839..22c89af8aa 100644
--- a/printing/ppconstr.ml
+++ b/printing/ppconstr.ml
@@ -108,10 +108,12 @@ let pr_sep_com sep f c = pr_with_comments (constr_loc c) (sep() ++ f c)
let pr_in_comment pr x = str "(* " ++ pr x ++ str " *)"
+let pr_in_braces pr x = str "{" ++ pr x ++ str "}"
+
let pr_glob_sort = function
| GProp -> str "Prop"
| GSet -> str "Set"
- | GType u -> hov 0 (str "Type" ++ pr_opt (pr_in_comment str) u)
+ | GType u -> hov 0 (str "Type" ++ pr_opt_no_spc (pr_in_braces str) u)
let pr_id = pr_id
let pr_name = pr_name
@@ -127,7 +129,8 @@ let pr_glob_sort_instance = function
| None -> str "Type")
let pr_universe_instance l =
- pr_opt (pr_in_comment (prlist_with_sep spc pr_glob_sort_instance)) l
+ pr_opt_no_spc (fun i ->
+ str"@" ++ pr_in_braces (prlist_with_sep spc pr_glob_sort_instance) i) l
let pr_cref ref us =
pr_reference ref ++ pr_universe_instance us