diff src/compiler.sml @ 134:18299126a343

MonoShake
author Adam Chlipala <adamc@hcoop.net>
date Thu, 17 Jul 2008 13:12:16 -0400
parents 55d8cfa4d024
children b1cfe49ce692
line wrap: on
line diff
--- a/src/compiler.sml	Thu Jul 17 12:59:52 2008 -0400
+++ b/src/compiler.sml	Thu Jul 17 13:12:16 2008 -0400
@@ -259,8 +259,17 @@
         else
             SOME (MonoReduce.reduce file)
 
+fun mono_shake job =
+    case mono_reduce job of
+        NONE => NONE
+      | SOME file =>
+        if ErrorMsg.anyErrors () then
+            NONE
+        else
+            SOME (MonoShake.shake file)
+
 fun mono_opt job =
-    case mono_reduce job of
+    case mono_shake job of
         NONE => NONE
       | SOME file =>
         if ErrorMsg.anyErrors () then
@@ -384,6 +393,15 @@
     handle MonoEnv.UnboundNamed n =>
            print ("Unbound named " ^ Int.toString n ^ "\n")
 
+fun testMono_shake job =
+    (case mono_shake 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"