summaryrefslogtreecommitdiff
path: root/src/expl_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 10:13:18 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 10:13:18 -0400
commit1e03bdf0b6f423870abcf5e54ae7f2bdf08e3e49 (patch)
tree39ac50f2c17e5c8068db2294a5bc3ee89e88cf1a /src/expl_print.sml
parentdcfd6390610712e9d498cdb4e466eb932a6bb138 (diff)
Explifying (non-mutual) 'val rec'
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,