diff options
Diffstat (limited to 'src/core_print.sml')
-rw-r--r-- | src/core_print.sml | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/src/core_print.sml b/src/core_print.sml index 60ad619f..3436d313 100644 --- a/src/core_print.sml +++ b/src/core_print.sml @@ -240,7 +240,31 @@ 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_con env t, + space, + string "=", + space, + p_exp env e] + end + +fun p_decl env (dAll as (d, _) : decl) = case d of DCon (x, n, k, c) => let @@ -263,30 +287,18 @@ fun p_decl env ((d, _) : decl) = space, p_con env c] end - | 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_con 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 n => box [string "export", space, |