changeset 263:02e1870a0516

Monoize OFFSET
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 16:11:15 -0400
parents a6cb33f49366
children 35ed669a253f
files src/monoize.sml tests/limit.ur
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/monoize.sml	Sun Aug 31 16:10:20 2008 -0400
+++ b/src/monoize.sml	Sun Aug 31 16:11:15 2008 -0400
@@ -752,6 +752,16 @@
 
           | L.EFfi ("Basis", "sql_no_offset") =>
             ((L'.EPrim (Prim.String ""), loc), fm)
+          | L.EFfiApp ("Basis", "sql_offset", [e]) =>
+            let
+                val (e, fm) = monoExp (env, st, fm) e
+            in
+                (strcat loc [
+                 (L'.EPrim (Prim.String " OFFSET "), loc),
+                 (L'.EFfiApp ("Basis", "sqlifyInt", [e]), loc)
+                 ],
+                 fm)
+            end
 
           | L.EFfi ("Basis", "sql_eq") =>
             ((L'.EPrim (Prim.String "="), loc), fm)
--- a/tests/limit.ur	Sun Aug 31 16:10:20 2008 -0400
+++ b/tests/limit.ur	Sun Aug 31 16:11:15 2008 -0400
@@ -10,7 +10,7 @@
 datatype list a = Nil | Cons of a * list a
 
 val r1 : transaction (list {A : int, B : string, C : float}) =
-        query (q2 3)
+        query (q4 3 7)
         (fn fs acc => return (Cons (fs.T, acc)))
         Nil