comparison src/mono_opt.sml @ 187:fb6ed259f5bd

Mono_opt for urlifying bools
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 19:01:16 -0400
parents 19ee24bffbc0
children 8e9f97508f0d
comparison
equal deleted inserted replaced
186:88d46972de53 187:fb6ed259f5bd
183 | EWrite (EFfiApp ("Basis", "urlifyString", [(EPrim (Prim.String s), _)]), loc) => 183 | EWrite (EFfiApp ("Basis", "urlifyString", [(EPrim (Prim.String s), _)]), loc) =>
184 EWrite (EPrim (Prim.String (urlifyString s)), loc) 184 EWrite (EPrim (Prim.String (urlifyString s)), loc)
185 | EWrite (EFfiApp ("Basis", "urlifyString", [e]), _) => 185 | EWrite (EFfiApp ("Basis", "urlifyString", [e]), _) =>
186 EFfiApp ("Basis", "urlifyString_w", [e]) 186 EFfiApp ("Basis", "urlifyString_w", [e])
187 187
188 | EFfiApp ("Basis", "urlifyBool", [(ECon (PConFfi {con = "True", ...}, NONE), _)]) =>
189 EPrim (Prim.String "1")
190 | EFfiApp ("Basis", "urlifyBool", [(ECon (PConFfi {con = "False", ...}, NONE), _)]) =>
191 EPrim (Prim.String "0")
192 | EWrite (EFfiApp ("Basis", "urlifyBool", [(ECon (PConFfi {con = "True", ...}, NONE), _)]), loc) =>
193 EWrite (EPrim (Prim.String "1"), loc)
194 | EWrite (EFfiApp ("Basis", "urlifyBool", [(ECon (PConFfi {con = "False", ...}, NONE), _)]), loc) =>
195 EWrite (EPrim (Prim.String "0"), loc)
196 | EWrite (EFfiApp ("Basis", "urlifyBool", [e]), _) =>
197 EFfiApp ("Basis", "urlifyBool_w", [e])
198
188 | EWrite (ECase (discE, pes, {disc, ...}), loc) => 199 | EWrite (ECase (discE, pes, {disc, ...}), loc) =>
189 optExp (ECase (discE, 200 optExp (ECase (discE,
190 map (fn (p, e) => (p, (EWrite e, loc))) pes, 201 map (fn (p, e) => (p, (EWrite e, loc))) pes,
191 {disc = disc, 202 {disc = disc,
192 result = (TRecord [], loc)}), loc) 203 result = (TRecord [], loc)}), loc)