X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/db427c6775f4d2babcabadbbea93117f593259c6..234b917a6149413bbbeab7dccfaeab5f16e43fe1:/src/print.sml diff --git a/src/print.sml b/src/print.sml index 1f661dd..4acf9f1 100644 --- a/src/print.sml +++ b/src/print.sml @@ -58,7 +58,9 @@ fun p_typ' pn (t, _) = parenIf pn [p_typ' true t1, space 1, string "->", space 1, p_typ' true t2] | TAction (p, r1, r2) => parenIf pn [p_predBoxed p, space 1, p_record r1, space 1, - string "->", space 1, p_record r2] + string "=>", space 1, p_record r2] + | TNested (p1, p2) => + parenIf pn [p_pred' false p1, space 1, string "=>", space 1, p_pred' false p2] | TError => string "" | TUnif (_, ref (SOME t)) => p_typ' pn t @@ -101,6 +103,7 @@ fun p_exp (e, _) = | EVar x => string x | EApp (e1, e2) => dBox [string "(", p_exp e1, break {nsp = 1, offset = 0}, p_exp e2, string ")"] + | ESkip => string "_" | ESet (x, e) => dBox [string x, space 1, string "=", space 1, p_exp e] | EGet (x1, x2, e) => dBox [dBox [string x1, space 1, string "<-", space 1, string x2, string ";", space 1], @@ -113,7 +116,9 @@ fun p_exp (e, _) = string "in", space 1, p_exp e2, space 1, string "end"] - | ELocal _ => raise Fail "Unexpected ELocal form" + | ELocal e => dBox [string "local(", space 1, p_exp e, string ")"] + | EWith (e1, (ESkip, _)) => dBox [p_exp e1, space 1, string "with", space 1, string "end"] + | EWith (e1, e2) => dBox [p_exp e1, space 1, string "with", p_exp e2, space 1, string "end"] fun printd d = let