diff src/monoize.sml @ 1293:acabf3935060

tryDml
author Adam Chlipala <adam@chlipala.net>
date Sun, 05 Sep 2010 14:00:57 -0400
parents a671c986f517
children b4480a56cab7
line wrap: on
line diff
--- a/src/monoize.sml	Sun Sep 05 12:50:06 2010 -0400
+++ b/src/monoize.sml	Sun Sep 05 14:00:57 2010 -0400
@@ -1748,7 +1748,15 @@
             let
                 val (e, fm) = monoExp (env, st, fm) e
             in
-                ((L'.EDml e, loc),
+                ((L'.EDml (e, L'.Error), loc),
+                 fm)
+            end
+
+          | L.EFfiApp ("Basis", "tryDml", [e]) =>
+            let
+                val (e, fm) = monoExp (env, st, fm) e
+            in
+                ((L'.EDml (e, L'.None), loc),
                  fm)
             end
 
@@ -4014,13 +4022,13 @@
                             val e =
                                 foldl (fn ((x, v), e) =>
                                           (L'.ESeq (
-                                           (L'.EDml (L'.EStrcat (
-                                                     (L'.EPrim (Prim.String ("UPDATE uw_"
-                                                                             ^ tab
-                                                                             ^ " SET uw_"
-                                                                             ^ x
-                                                                             ^ " = NULL WHERE ")), loc),
-                                                     cond (x, v)), loc), loc),
+                                           (L'.EDml ((L'.EStrcat (
+                                                      (L'.EPrim (Prim.String ("UPDATE uw_"
+                                                                              ^ tab
+                                                                              ^ " SET uw_"
+                                                                              ^ x
+                                                                              ^ " = NULL WHERE ")), loc),
+                                                      cond (x, v)), loc), L'.Error), loc),
                                            e), loc))
                                       e nullable
 
@@ -4039,7 +4047,7 @@
                                                                                         ^ tab
                                                                                         ^ " WHERE ")), loc),
                                                                 cond eb), loc)
-                                                   ebs), loc),
+                                                   ebs, L'.Error), loc),
                                      e), loc)
                         in
                             e
@@ -4067,15 +4075,15 @@
                                     [] => e
                                   | (x, _) :: ebs =>
                                     (L'.ESeq (
-                                     (L'.EDml (L'.EPrim (Prim.String
-                                                             (foldl (fn ((x, _), s) =>
-                                                                        s ^ ", uw_" ^ x ^ " = NULL")
-                                                                    ("UPDATE uw_"
-                                                                     ^ tab
-                                                                     ^ " SET uw_"
-                                                                     ^ x
-                                                                     ^ " = NULL")
-                                                                    ebs)), loc), loc),
+                                     (L'.EDml ((L'.EPrim (Prim.String
+                                                              (foldl (fn ((x, _), s) =>
+                                                                         s ^ ", uw_" ^ x ^ " = NULL")
+                                                                     ("UPDATE uw_"
+                                                                      ^ tab
+                                                                      ^ " SET uw_"
+                                                                      ^ x
+                                                                      ^ " = NULL")
+                                                                     ebs)), loc), L'.Error), loc),
                                      e), loc)
 
                             val e =
@@ -4083,8 +4091,8 @@
                                     [] => e
                                   | eb :: ebs =>
                                     (L'.ESeq (
-                                     (L'.EDml (L'.EPrim (Prim.String ("DELETE FROM uw_"
-                                                                      ^ tab)), loc), loc),
+                                     (L'.EDml ((L'.EPrim (Prim.String ("DELETE FROM uw_"
+                                                                       ^ tab)), loc), L'.Error), loc),
                                      e), loc)
                         in
                             e