summaryrefslogtreecommitdiff
path: root/src/main.mlton.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-12-24 10:02:48 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-12-24 10:02:48 -0500
commit0c607fbf24eb6e55f99f80ee725c02f94cc10d1a (patch)
treedc52de3d21f2f622545e1a955a42aff636665da2 /src/main.mlton.sml
parentb1c0d23525d6a0e8080ce973492c48628c39c717 (diff)
-tc flag
Diffstat (limited to 'src/main.mlton.sml')
-rw-r--r--src/main.mlton.sml12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.mlton.sml b/src/main.mlton.sml
index ff54a7fa..36d0ce98 100644
--- a/src/main.mlton.sml
+++ b/src/main.mlton.sml
@@ -26,6 +26,7 @@
*)
val timing = ref false
+val tc = ref false
val sources = ref ([] : string list)
val demo = ref (NONE : (string * bool) option)
@@ -53,6 +54,9 @@ fun doArgs args =
| "-timing" :: rest =>
(timing := true;
doArgs rest)
+ | "-tc" :: rest =>
+ (tc := true;
+ doArgs rest)
| "-output" :: s :: rest =>
(Settings.setExe (SOME s);
doArgs rest)
@@ -78,7 +82,13 @@ val () =
SOME (prefix, guided) =>
Demo.make {prefix = prefix, dirname = job, guided = guided}
| NONE =>
- if !timing then
+ if !tc then
+ (Compiler.check Compiler.toElaborate job;
+ if ErrorMsg.anyErrors () then
+ OS.Process.exit OS.Process.failure
+ else
+ ())
+ else if !timing then
Compiler.time Compiler.toCjrize job
else
Compiler.compiler job