diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-07-17 10:09:34 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-07-17 10:09:34 -0400 |
commit | dcfd6390610712e9d498cdb4e466eb932a6bb138 (patch) | |
tree | 83ba4c2e9b1d7a6ef837f323bed5a279b517fdb9 /src/source_print.sml | |
parent | c8dc6a0ab0a9f64a6d5bd1bfae94f04dc941e26d (diff) |
Parsing and elaborating (non-mutual) 'val rec'
Diffstat (limited to 'src/source_print.sml')
-rw-r--r-- | src/source_print.sml | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/source_print.sml b/src/source_print.sml index 760f46bf..245ee79e 100644 --- a/src/source_print.sml +++ b/src/source_print.sml @@ -329,6 +329,23 @@ and p_sgn (sgn, _) = | SgnProj (m, ms, x) => p_list_sep (string ".") string (m :: ms @ [x]) +fun p_vali (x, co, e) = + case co of + NONE => box [string x, + space, + string "=", + space, + p_exp e] + | SOME t => box [string x, + space, + string ":", + space, + p_con t, + space, + string "=", + space, + p_exp e] + fun p_decl ((d, _) : decl) = case d of DCon (x, NONE, c) => box [string "con", @@ -349,24 +366,14 @@ fun p_decl ((d, _) : decl) = string "=", space, p_con c] - | DVal (x, NONE, e) => box [string "val", - space, - string x, - space, - string "=", - space, - p_exp e] - | DVal (x, SOME t, e) => box [string "val", - space, - string x, - space, - string ":", - space, - p_con t, - space, - string "=", - space, - p_exp e] + | DVal vi => box [string "val", + space, + p_vali vi] + | DValRec vis => box [string "val", + space, + string "rec", + space, + p_list_sep (box [newline, string "and", space]) p_vali vis] | DSgn (x, sgn) => box [string "signature", space, |