aboutsummaryrefslogtreecommitdiffhomepage
path: root/printing/ppconstr.ml
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2017-02-04 14:56:04 +0100
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-03-24 12:22:21 +0100
commiteec5145a5c6575d04b5ab442597fb52913daed29 (patch)
treeefdc1db3c3b4db77cc5d5382b8424794db5f4201 /printing/ppconstr.ml
parent6899bace8e617f38fadce0b4b660d951d73af5d0 (diff)
Applying same convention as in Definition for printing type in a let in.
Also adding spaces around ":=" and ":" when printed as "(x : t := c)". Example: Check fun y => let x : True := I in fun z => z+y=0. (* λ (y : nat) (x : True := I) (z : nat), z + y = 0 : nat → nat → Prop *)
Diffstat (limited to 'printing/ppconstr.ml')
-rw-r--r--printing/ppconstr.ml11
1 files changed, 6 insertions, 5 deletions
diff --git a/printing/ppconstr.ml b/printing/ppconstr.ml
index 0013d49a1..f36c8c153 100644
--- a/printing/ppconstr.ml
+++ b/printing/ppconstr.ml
@@ -363,8 +363,9 @@ let tag_var = tag Tag.variable
| CLocalAssum (nal,k,t) ->
pr_binder true pr_c (nal,k,t)
| CLocalDef (na,c,topt) ->
- surround (pr_lname na ++ str":=" ++ cut() ++ pr_c c ++
- pr_opt_no_spc (fun t -> cut () ++ str ":" ++ pr_c t) topt)
+ surround (pr_lname na ++
+ pr_opt_no_spc (fun t -> str " :" ++ ws 1 ++ pr_c t) topt ++
+ str" :=" ++ spc() ++ pr_c c)
| CLocalPattern (loc,p,tyo) ->
let p = pr_patt lsimplepatt p in
match tyo with
@@ -598,9 +599,9 @@ let tag_var = tag Tag.variable
| CLetIn (_,x,a,t,b) ->
return (
hv 0 (
- hov 2 (keyword "let" ++ spc () ++ pr_lname x ++ str " :="
- ++ pr spc ltop a ++ spc ()
- ++ pr_opt_no_spc (fun t -> str ":" ++ ws 1 ++ pr mt ltop t ++ spc ()) t
+ hov 2 (keyword "let" ++ spc () ++ pr_lname x
+ ++ pr_opt_no_spc (fun t -> str " :" ++ ws 1 ++ pr mt ltop t) t
+ ++ str " :=" ++ pr spc ltop a ++ spc ()
++ keyword "in") ++
pr spc ltop b),
lletin