comparison 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
comparison
equal deleted inserted replaced
174:7ee424760d2f 175:b2d752455182
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 223 | PRecord (xps, flex) =>
224 val p_pat = p_pat' false 224 let
225 val pps = map (fn (x, p) => box [string x, space, string "=", space, p_pat env p]) xps
226 in
227 box [string "{",
228 p_list_sep (box [string ",", space]) (fn x => x)
229 (case flex of
230 NONE => pps
231 | SOME _ => pps @ [string "..."]),
232 string "}"]
233 end
234
235 and p_pat x = p_pat' false x
225 236
226 fun p_exp' par env (e, _) = 237 fun p_exp' par env (e, _) =
227 case e of 238 case e of
228 EPrim p => Prim.p_t p 239 EPrim p => Prim.p_t p
229 | ERel n => 240 | ERel n =>