From 183c43eb783edd68f76f941fa61b6ef1f8752a56 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 31 Jul 2008 11:28:55 -0400 Subject: Elaborating module constructor patterns; parsing record patterns --- src/source_print.sml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/source_print.sml') 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 -- cgit v1.2.3