Mercurial > urweb
comparison src/main.mlton.sml @ 1086:99aebdf30257
-tc flag
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 24 Dec 2009 10:02:48 -0500 |
parents | 36efaf119b85 |
children | bed675db3aff |
comparison
equal
deleted
inserted
replaced
1085:ae885ad70d83 | 1086:99aebdf30257 |
---|---|
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
25 * POSSIBILITY OF SUCH DAMAGE. | 25 * POSSIBILITY OF SUCH DAMAGE. |
26 *) | 26 *) |
27 | 27 |
28 val timing = ref false | 28 val timing = ref false |
29 val tc = ref false | |
29 val sources = ref ([] : string list) | 30 val sources = ref ([] : string list) |
30 val demo = ref (NONE : (string * bool) option) | 31 val demo = ref (NONE : (string * bool) option) |
31 | 32 |
32 fun doArgs args = | 33 fun doArgs args = |
33 case args of | 34 case args of |
51 (Settings.setDebug true; | 52 (Settings.setDebug true; |
52 doArgs rest) | 53 doArgs rest) |
53 | "-timing" :: rest => | 54 | "-timing" :: rest => |
54 (timing := true; | 55 (timing := true; |
55 doArgs rest) | 56 doArgs rest) |
57 | "-tc" :: rest => | |
58 (tc := true; | |
59 doArgs rest) | |
56 | "-output" :: s :: rest => | 60 | "-output" :: s :: rest => |
57 (Settings.setExe (SOME s); | 61 (Settings.setExe (SOME s); |
58 doArgs rest) | 62 doArgs rest) |
59 | "-sql" :: s :: rest => | 63 | "-sql" :: s :: rest => |
60 (Settings.setSql (SOME s); | 64 (Settings.setSql (SOME s); |
76 val () = | 80 val () = |
77 case !demo of | 81 case !demo of |
78 SOME (prefix, guided) => | 82 SOME (prefix, guided) => |
79 Demo.make {prefix = prefix, dirname = job, guided = guided} | 83 Demo.make {prefix = prefix, dirname = job, guided = guided} |
80 | NONE => | 84 | NONE => |
81 if !timing then | 85 if !tc then |
86 (Compiler.check Compiler.toElaborate job; | |
87 if ErrorMsg.anyErrors () then | |
88 OS.Process.exit OS.Process.failure | |
89 else | |
90 ()) | |
91 else if !timing then | |
82 Compiler.time Compiler.toCjrize job | 92 Compiler.time Compiler.toCjrize job |
83 else | 93 else |
84 Compiler.compiler job | 94 Compiler.compiler job |