changeset 346:a94a79820d49

Small clean-ups in crud; Compiler.check
author Adam Chlipala <adamc@hcoop.net>
date Sat, 04 Oct 2008 15:54:03 -0400
parents b85e6ba56618
children 58eeeb3cbf40
files src/compiler.sig src/compiler.sml tests/crud.ur tests/crud.urs
diffstat 4 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/compiler.sig	Sat Oct 04 15:50:28 2008 -0400
+++ b/src/compiler.sig	Sat Oct 04 15:54:03 2008 -0400
@@ -45,6 +45,7 @@
     val transform : ('src, 'dst) phase -> string -> ('src, 'dst) transform
     val o : ('b, 'c) transform * ('a, 'b) transform -> ('a, 'c) transform
 
+    val check : ('src, 'dst) transform -> 'src -> unit
     val run : ('src, 'dst) transform -> 'src -> 'dst option
     val runPrint : ('src, 'dst) transform -> 'src -> unit
     val time : ('src, 'dst) transform -> 'src -> unit
--- a/src/compiler.sml	Sat Oct 04 15:50:28 2008 -0400
+++ b/src/compiler.sml	Sat Oct 04 15:54:03 2008 -0400
@@ -93,6 +93,9 @@
               end
 }
 
+fun check (tr : ('src, 'dst) transform) x = (ErrorMsg.resetErrors ();
+                                             ignore (#func tr x))
+
 fun run (tr : ('src, 'dst) transform) x = (ErrorMsg.resetErrors ();
                                            #func tr x)
 
--- a/tests/crud.ur	Sat Oct 04 15:50:28 2008 -0400
+++ b/tests/crud.ur	Sat Oct 04 15:54:03 2008 -0400
@@ -80,7 +80,7 @@
         <p><a link={delete id}>I was born sure!</a></p>
 </body></html>
 
-fun main () : transaction page =
+fun main () =
         rows <- queryX (SELECT * FROM tab AS T)
                 (fn (fs : {T : $([Id = int] ++ mapT2T fstTT M.cols)}) => <body>
                         <tr>
--- a/tests/crud.urs	Sat Oct 04 15:50:28 2008 -0400
+++ b/tests/crud.urs	Sat Oct 04 15:54:03 2008 -0400
@@ -6,7 +6,7 @@
         Parse : t_formT.2 -> t_formT.1,
         Inject : sql_injectable t_formT.1
 }
-con colsMeta = fn cols :: {(Type * Type)} => $(Top.mapT2T colMeta cols)
+con colsMeta = fn cols :: {(Type * Type)} => $(mapT2T colMeta cols)
 
 functor Make(M : sig
         con cols :: {(Type * Type)}