comparison src/sql.sml @ 2215:639e62ca2530

Mostly finish effectfulness analysis.
author Ziv Scully <ziv@mit.edu>
date Fri, 31 Oct 2014 09:25:03 -0400
parents 365727ff68f4
children 70ec9bb337be
comparison
equal deleted inserted replaced
2214:edd634b889d0 2215:639e62ca2530
270 270
271 | _ => NONE 271 | _ => NONE
272 272
273 fun sqlifySqlcache chs = 273 fun sqlifySqlcache chs =
274 case chs of 274 case chs of
275 (* Match entire FFI application, not just its argument. *) 275 (* Could have variables as well as FFIs. *)
276 Exp (e' as EFfiApp ("Basis", f, [(_, _)]), _) :: chs => 276 Exp (e as (ERel _, _)) :: chs => SOME (e, chs)
277 (* If it is an FFI, match the entire expression. *)
278 | Exp (e as (EFfiApp ("Basis", f, [(_, _)]), _)) :: chs =>
277 if String.isPrefix "sqlify" f then 279 if String.isPrefix "sqlify" f then
278 SOME ((e', ErrorMsg.dummySpan), chs) 280 SOME (e, chs)
279 else 281 else
280 NONE 282 NONE
281 | Exp (ECase (e, [((PCon (_, PConFfi {mod = "Basis", con = "True", ...}, NONE), _), 283 | Exp (ECase (e, [((PCon (_, PConFfi {mod = "Basis", con = "True", ...}, NONE), _),
282 (EPrim (Prim.String (Prim.Normal, "TRUE")), _)), 284 (EPrim (Prim.String (Prim.Normal, "TRUE")), _)),
283 ((PCon (_, PConFfi {mod = "Basis", con = "False", ...}, NONE), _), 285 ((PCon (_, PConFfi {mod = "Basis", con = "False", ...}, NONE), _),