summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-10-04 15:54:03 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-10-04 15:54:03 -0400
commit820db2a3a1c185ea91d8a8f14a30a52489595e3f (patch)
tree34129241fe804b98db1256b4d9ef9ba2ed1458ef
parent2eca16323e58b01a70ea734e2825765ebe239dc0 (diff)
Small clean-ups in crud; Compiler.check
-rw-r--r--src/compiler.sig1
-rw-r--r--src/compiler.sml3
-rw-r--r--tests/crud.ur2
-rw-r--r--tests/crud.urs2
4 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler.sig b/src/compiler.sig
index 1388537f..833c647f 100644
--- a/src/compiler.sig
+++ b/src/compiler.sig
@@ -45,6 +45,7 @@ signature COMPILER = sig
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
diff --git a/src/compiler.sml b/src/compiler.sml
index 569980f4..3d2ce354 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -93,6 +93,9 @@ fun op o (tr2 : ('b, 'c) transform, tr1 : ('a, 'b) transform) = {
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)
diff --git a/tests/crud.ur b/tests/crud.ur
index 7944cf6c..6479da19 100644
--- a/tests/crud.ur
+++ b/tests/crud.ur
@@ -80,7 +80,7 @@ fun confirm (id : int) = return <html><body>
<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>
diff --git a/tests/crud.urs b/tests/crud.urs
index 3056392c..8ef81b87 100644
--- a/tests/crud.urs
+++ b/tests/crud.urs
@@ -6,7 +6,7 @@ con colMeta = fn t_formT :: (Type * Type) => {
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)}