diff src/compiler.sml @ 131:5df655503288

Untangle
author Adam Chlipala <adamc@hcoop.net>
date Thu, 17 Jul 2008 12:19:44 -0400
parents 0644d3c3bedf
children 25b28625d4df
line wrap: on
line diff
--- a/src/compiler.sml	Thu Jul 17 11:20:07 2008 -0400
+++ b/src/compiler.sml	Thu Jul 17 12:19:44 2008 -0400
@@ -232,8 +232,17 @@
         else
             SOME (Monoize.monoize CoreEnv.empty file)
 
+fun untangle job =
+    case monoize job of
+        NONE => NONE
+      | SOME file =>
+        if ErrorMsg.anyErrors () then
+            NONE
+        else
+            SOME (Untangle.untangle file)
+
 fun mono_opt job =
-    case monoize job of
+    case untangle job of
         NONE => NONE
       | SOME file =>
         if ErrorMsg.anyErrors () then
@@ -304,7 +313,7 @@
            print ("Unbound named " ^ Int.toString n ^ "\n")
 
 fun testReduce job =
-    (case reduce job of
+    (case tag job of
          NONE => print "Failed\n"
        | SOME file =>
          (Print.print (CorePrint.p_file CoreEnv.empty file);
@@ -330,6 +339,15 @@
     handle MonoEnv.UnboundNamed n =>
            print ("Unbound named " ^ Int.toString n ^ "\n")
 
+fun testUntangle job =
+    (case untangle 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"