diff 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
line wrap: on
line diff
--- a/src/sql.sml	Tue Oct 14 18:07:09 2014 -0400
+++ b/src/sql.sml	Fri Oct 31 09:25:03 2014 -0400
@@ -272,10 +272,12 @@
 
 fun sqlifySqlcache chs =
     case chs of
-        (* Match entire FFI application, not just its argument. *)
-        Exp (e' as EFfiApp ("Basis", f, [(_, _)]), _) :: chs =>
+      (* Could have variables as well as FFIs. *)
+        Exp (e as (ERel _, _)) :: chs => SOME (e, chs)
+      (* If it is an FFI, match the entire expression. *)
+      | Exp (e as (EFfiApp ("Basis", f, [(_, _)]), _)) :: chs =>
         if String.isPrefix "sqlify" f then
-            SOME ((e', ErrorMsg.dummySpan), chs)
+            SOME (e, chs)
         else
             NONE
       | Exp (ECase (e, [((PCon (_, PConFfi {mod = "Basis", con = "True", ...}, NONE), _),