diff options
Diffstat (limited to 'src/mono_print.sml')
-rw-r--r-- | src/mono_print.sml | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/src/mono_print.sml b/src/mono_print.sml index 67369b1f..a4fda230 100644 --- a/src/mono_print.sml +++ b/src/mono_print.sml @@ -138,32 +138,44 @@ fun p_exp' par env (e, _) = and p_exp env = p_exp' false env -fun p_decl env ((d, _) : decl) = +fun p_vali env (x, n, t, e, s) = + let + val xp = if !debug then + box [string x, + string "__", + string (Int.toString n)] + else + string x + in + box [xp, + space, + string "as", + space, + string s, + space, + string ":", + space, + p_typ env t, + space, + string "=", + space, + p_exp env e] + end + +fun p_decl env (dAll as (d, _) : decl) = case d of - DVal (x, n, t, e, s) => + DVal vi => box [string "val", + space, + p_vali env vi] + | DValRec vis => let - val xp = if !debug then - box [string x, - string "__", - string (Int.toString n)] - else - string x + val env = E.declBinds env dAll in box [string "val", space, - xp, - space, - string "as", - space, - string s, - space, - string ":", - space, - p_typ env t, - space, - string "=", + string "rec", space, - p_exp env e] + p_list_sep (box [newline, string "and", space]) (p_vali env) vis] end | DExport (s, n, ts) => box [string "export", |