Commit beb9b0c2 by POTTIER Francois

Print pairs without parentheses.

(The previous code could lead to double pairs of parentheses.)
Cosmetic changes in the printer.
parent 2e8bb630
......@@ -5,9 +5,6 @@ open F
let arrow =
string "->"
let backslash =
string "\\"
let doublebackslash =
string "\\\\"
......@@ -17,7 +14,7 @@ let forall =
let rec typ0 ty =
match ty with
| TyVar x ->
string x
string x
| TyArrow _
| TyProduct _
| TyForall _ ->
......@@ -69,7 +66,7 @@ and term1 t =
and term2 t =
match t with
| TePair (t1, t2) ->
group (lparen ^^ term1 t1 ^^ comma ^/^ term2 t2 ^^ rparen)
group (term1 t1 ^^ comma ^/^ term2 t2)
| _ ->
term1 t
......@@ -77,8 +74,8 @@ and term3 t =
match t with
| TeAbs (x, ty, t) ->
block
(backslash ^^ string "(" ^^ string x ^^ spacecolon)
(break 1 ^^ typ ty ^^ string ")")
(backslash ^^ lparen ^^ string x ^^ spacecolon)
(break 1 ^^ typ ty ^^ rparen)
(break 1 ^^ dot)
^/^
term3 t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment