summaryrefslogtreecommitdiff
path: root/src/expl_print.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/expl_print.sml')
-rw-r--r--src/expl_print.sml36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/expl_print.sml b/src/expl_print.sml
index 1e8f514a..095a6e24 100644
--- a/src/expl_print.sml
+++ b/src/expl_print.sml
@@ -345,7 +345,17 @@ and p_sgn env (sgn, _) =
p_list_sep (string ".") string (m1x :: ms @ [x])
end
-fun p_decl env ((d, _) : decl) =
+fun p_vali env (x, n, t, e) = box [p_named x n,
+ space,
+ string ":",
+ space,
+ p_con env t,
+ space,
+ string "=",
+ space,
+ p_exp env e]
+
+fun p_decl env (dAll as (d, _) : decl) =
case d of
DCon (x, n, k, c) => box [string "con",
space,
@@ -358,17 +368,19 @@ fun p_decl env ((d, _) : decl) =
string "=",
space,
p_con env c]
- | DVal (x, n, t, e) => box [string "val",
- space,
- p_named x n,
- space,
- string ":",
- space,
- p_con env t,
- space,
- string "=",
- space,
- p_exp env e]
+ | DVal vi => box [string "val",
+ space,
+ p_vali env vi]
+ | DValRec vis =>
+ let
+ val env = E.declBinds env dAll
+ in
+ box [string "val",
+ space,
+ string "rec",
+ space,
+ p_list_sep (box [newline, string "and", space]) (p_vali env) vis]
+ end
| DSgn (x, n, sgn) => box [string "signature",
space,