comparison src/source_print.sml @ 175:b2d752455182

Elaborating record patterns
author Adam Chlipala <adamc@hcoop.net>
date Thu, 31 Jul 2008 13:08:57 -0400
parents 7ee424760d2f
children aa54250f58ac
comparison
equal deleted inserted replaced
174:7ee424760d2f 175:b2d752455182
171 | PCon (ms, x, SOME p) => parenIf par (box [p_list_sep (string ".") string (ms @ [x]), 171 | PCon (ms, x, SOME p) => parenIf par (box [p_list_sep (string ".") string (ms @ [x]),
172 space, 172 space,
173 p_pat' true p]) 173 p_pat' true p])
174 | PRecord (xps, flex) => 174 | PRecord (xps, flex) =>
175 let 175 let
176 val pps = map (fn (x, p) => box [string "x", space, string "=", space, p_pat p]) xps 176 val pps = map (fn (x, p) => box [string x, space, string "=", space, p_pat p]) xps
177 in 177 in
178 box [string "{", 178 box [string "{",
179 p_list_sep (box [string ",", space]) (fn x => x) 179 p_list_sep (box [string ",", space]) (fn x => x)
180 (if flex then 180 (if flex then
181 pps 181 pps @ [string "..."]
182 else 182 else
183 pps @ [string "..."]), 183 pps),
184 string "}"] 184 string "}"]
185 end 185 end
186 186
187 and p_pat x = p_pat' false x 187 and p_pat x = p_pat' false x
188 188