diff src/elab_print.sml @ 175:b2d752455182

Elaborating record patterns
author Adam Chlipala <adamc@hcoop.net>
date Thu, 31 Jul 2008 13:08:57 -0400
parents 8221b95cc24c
children 33d4a8eea484
line wrap: on
line diff
--- a/src/elab_print.sml	Thu Jul 31 11:28:55 2008 -0400
+++ b/src/elab_print.sml	Thu Jul 31 13:08:57 2008 -0400
@@ -220,8 +220,19 @@
       | PCon (pc, SOME p) => parenIf par (box [p_patCon env pc,
                                                space,
                                                p_pat' true env p])
+      | PRecord (xps, flex) =>
+        let
+            val pps = map (fn (x, p) => box [string x, space, string "=", space, p_pat env p]) xps
+        in
+            box [string "{",
+                 p_list_sep (box [string ",", space]) (fn x => x)
+                 (case flex of
+                      NONE => pps
+                    | SOME _ => pps @ [string "..."]),
+                 string "}"]
+        end
 
-val p_pat = p_pat' false
+and p_pat x = p_pat' false x
 
 fun p_exp' par env (e, _) =
     case e of