diff src/demo.sml @ 1079:d069b193ed6b

Especialize uses a termination measure based on number of arguments introduced
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Dec 2009 19:26:52 -0500
parents 93315ac00394
children de48dc2c9ee8
line wrap: on
line diff
--- a/src/demo.sml	Tue Dec 15 13:20:13 2009 -0500
+++ b/src/demo.sml	Tue Dec 15 19:26:52 2009 -0500
@@ -27,7 +27,7 @@
 
 structure Demo :> DEMO = struct
 
-fun make {prefix, dirname, guided} =
+fun make' {prefix, dirname, guided} =
     let
         val prose = OS.Path.joinDirFile {dir = dirname,
                                          file = "prose"}
@@ -430,13 +430,23 @@
 
                 TextIO.closeOut outf;
 
-                Compiler.compiler (OS.Path.base fname)
-            end;
-
-        TextIO.output (demosOut, "\n</body></html>\n");
-        TextIO.closeOut demosOut;
-
-        prettyPrint ()
+                let
+                    val b = Compiler.compile (OS.Path.base fname)
+                in
+                    TextIO.output (demosOut, "\n</body></html>\n");
+                    TextIO.closeOut demosOut;
+                    if b then
+                        prettyPrint ()
+                    else
+                        ();
+                    b
+                end
+            end
     end
 
+fun make args = if make' args then
+                    ()
+                else
+                    OS.Process.exit OS.Process.failure
+
 end