aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/source_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-31 11:28:55 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-31 11:28:55 -0400
commit183c43eb783edd68f76f941fa61b6ef1f8752a56 (patch)
tree30aa4641257f0fccda2ac8209f56cedeb3c0e09d /src/source_print.sml
parentae494cac4389a07a6feef73a084e2db7ccb84e22 (diff)
Elaborating module constructor patterns; parsing record patterns
Diffstat (limited to 'src/source_print.sml')
-rw-r--r--src/source_print.sml16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/source_print.sml b/src/source_print.sml
index 68ef3508..93416fd3 100644
--- a/src/source_print.sml
+++ b/src/source_print.sml
@@ -171,8 +171,20 @@ fun p_pat' par (p, _) =
| PCon (ms, x, SOME p) => parenIf par (box [p_list_sep (string ".") string (ms @ [x]),
space,
p_pat' true p])
-
-val p_pat = p_pat' false
+ | PRecord (xps, flex) =>
+ let
+ val pps = map (fn (x, p) => box [string "x", space, string "=", space, p_pat p]) xps
+ in
+ box [string "{",
+ p_list_sep (box [string ",", space]) (fn x => x)
+ (if flex then
+ pps
+ else
+ pps @ [string "..."]),
+ string "}"]
+ end
+
+and p_pat x = p_pat' false x
fun p_exp' par (e, _) =
case e of