summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-06-10 15:56:33 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-06-10 15:56:33 -0400
commit0b48781249e7062928ff78ae3469a508a3e31eaa (patch)
tree9e6bdf99508109633f198c8a01948c165cad3b86 /src/compiler.sml
parentbe45a4a950e01689219ebc5032f53f66b012f660 (diff)
Closure conversion
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 20eb3ef5..26ff6e2b 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -103,6 +103,15 @@ fun monoize eenv cenv filename =
else
SOME (Monoize.monoize cenv file)
+fun cloconv eenv cenv filename =
+ case monoize eenv cenv filename of
+ NONE => NONE
+ | SOME file =>
+ if ErrorMsg.anyErrors () then
+ NONE
+ else
+ SOME (Cloconv.cloconv file)
+
fun testParse filename =
case parse filename of
NONE => print "Failed\n"
@@ -155,4 +164,13 @@ fun testMonoize filename =
handle MonoEnv.UnboundNamed n =>
print ("Unbound named " ^ Int.toString n ^ "\n")
+fun testCloconv filename =
+ (case cloconv ElabEnv.basis CoreEnv.basis filename of
+ NONE => print "Failed\n"
+ | SOME file =>
+ (Print.print (FlatPrint.p_file FlatEnv.basis file);
+ print "\n"))
+ handle FlatEnv.UnboundNamed n =>
+ print ("Unbound named " ^ Int.toString n ^ "\n")
+
end