comparison src/expl_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
177 end 177 end
178 178
179 fun p_pat' par env (p, _) = 179 fun p_pat' par env (p, _) =
180 case p of 180 case p of
181 PWild => string "_" 181 PWild => string "_"
182 | PVar s => string s 182 | PVar (s, _) => string s
183 | PPrim p => Prim.p_t p 183 | PPrim p => Prim.p_t p
184 | PCon (pc, NONE) => p_patCon env pc 184 | PCon (pc, NONE) => p_patCon env pc
185 | PCon (pc, SOME p) => parenIf par (box [p_patCon env pc, 185 | PCon (pc, SOME p) => parenIf par (box [p_patCon env pc,
186 space, 186 space,
187 p_pat' true env p]) 187 p_pat' true env p])
188 | PRecord xps => 188 | PRecord xps =>
189 box [string "{", 189 box [string "{",
190 p_list_sep (box [string ",", space]) (fn (x, p) => 190 p_list_sep (box [string ",", space]) (fn (x, p, _) =>
191 box [string x, 191 box [string x,
192 space, 192 space,
193 string "=", 193 string "=",
194 space, 194 space,
195 p_pat env p]) xps, 195 p_pat env p]) xps,