diff src/source_print.sml @ 174:7ee424760d2f

Elaborating module constructor patterns; parsing record patterns
author Adam Chlipala <adamc@hcoop.net>
date Thu, 31 Jul 2008 11:28:55 -0400
parents 8221b95cc24c
children b2d752455182
line wrap: on
line diff
--- a/src/source_print.sml	Thu Jul 31 10:44:52 2008 -0400
+++ b/src/source_print.sml	Thu Jul 31 11:28:55 2008 -0400
@@ -171,8 +171,20 @@
       | PCon (ms, x, SOME p) => parenIf par (box [p_list_sep (string ".") string (ms @ [x]),
                                                   space,
                                                   p_pat' true p])
+      | 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
 
-val p_pat = p_pat' false
+and p_pat x = p_pat' false x
 
 fun p_exp' par (e, _) =
     case e of