comparison src/elab_print.sml @ 182:d11754ffe252

Compiled pattern matching to C
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 12:43:20 -0400
parents 33d4a8eea484
children 8e9f97508f0d
comparison
equal deleted inserted replaced
181:31dfab1d4050 182:d11754ffe252
212 end 212 end
213 213
214 fun p_pat' par env (p, _) = 214 fun p_pat' par env (p, _) =
215 case p of 215 case p of
216 PWild => string "_" 216 PWild => string "_"
217 | PVar s => string s 217 | PVar (s, _) => string s
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 => 223 | PRecord xps =>
224 box [string "{", 224 box [string "{",
225 p_list_sep (box [string ",", space]) (fn (x, p) => 225 p_list_sep (box [string ",", space]) (fn (x, p, _) =>
226 box [string x, 226 box [string x,
227 space, 227 space,
228 string "=", 228 string "=",
229 space, 229 space,
230 p_pat env p]) xps, 230 p_pat env p]) xps,