diff src/compiler.sml @ 133:55d8cfa4d024

MonoReduce
author Adam Chlipala <adamc@hcoop.net>
date Thu, 17 Jul 2008 12:59:52 -0400
parents 25b28625d4df
children 18299126a343
line wrap: on
line diff
--- a/src/compiler.sml	Thu Jul 17 12:40:21 2008 -0400
+++ b/src/compiler.sml	Thu Jul 17 12:59:52 2008 -0400
@@ -250,8 +250,17 @@
         else
             SOME (Untangle.untangle file)
 
+fun mono_reduce job =
+    case untangle job of
+        NONE => NONE
+      | SOME file =>
+        if ErrorMsg.anyErrors () then
+            NONE
+        else
+            SOME (MonoReduce.reduce file)
+
 fun mono_opt job =
-    case untangle job of
+    case mono_reduce job of
         NONE => NONE
       | SOME file =>
         if ErrorMsg.anyErrors () then
@@ -366,6 +375,15 @@
     handle MonoEnv.UnboundNamed n =>
            print ("Unbound named " ^ Int.toString n ^ "\n")
 
+fun testMono_reduce job =
+    (case mono_reduce job of
+         NONE => print "Failed\n"
+       | SOME file =>
+         (Print.print (MonoPrint.p_file MonoEnv.empty file);
+          print "\n"))
+    handle MonoEnv.UnboundNamed n =>
+           print ("Unbound named " ^ Int.toString n ^ "\n")
+
 fun testMono_opt job =
     (case mono_opt job of
          NONE => print "Failed\n"