comparison src/elab_print.sml @ 176:33d4a8eea484

Case through explify
author Adam Chlipala <adamc@hcoop.net>
date Thu, 31 Jul 2008 16:28:55 -0400
parents b2d752455182
children d11754ffe252
comparison
equal deleted inserted replaced
175:b2d752455182 176:33d4a8eea484
218 | PPrim p => Prim.p_t p 218 | PPrim p => Prim.p_t p
219 | PCon (pc, NONE) => p_patCon env pc 219 | PCon (pc, NONE) => p_patCon env pc
220 | PCon (pc, SOME p) => parenIf par (box [p_patCon env pc, 220 | PCon (pc, SOME p) => parenIf par (box [p_patCon env pc,
221 space, 221 space,
222 p_pat' true env p]) 222 p_pat' true env p])
223 | PRecord (xps, flex) => 223 | PRecord xps =>
224 let 224 box [string "{",
225 val pps = map (fn (x, p) => box [string x, space, string "=", space, p_pat env p]) xps 225 p_list_sep (box [string ",", space]) (fn (x, p) =>
226 in 226 box [string x,
227 box [string "{", 227 space,
228 p_list_sep (box [string ",", space]) (fn x => x) 228 string "=",
229 (case flex of 229 space,
230 NONE => pps 230 p_pat env p]) xps,
231 | SOME _ => pps @ [string "..."]), 231 string "}"]
232 string "}"]
233 end
234 232
235 and p_pat x = p_pat' false x 233 and p_pat x = p_pat' false x
236 234
237 fun p_exp' par env (e, _) = 235 fun p_exp' par env (e, _) =
238 case e of 236 case e of