summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/explify.sml4
-rw-r--r--src/main.mlton.sml24
2 files changed, 27 insertions, 1 deletions
diff --git a/src/explify.sml b/src/explify.sml
index f33d2b64..da338147 100644
--- a/src/explify.sml
+++ b/src/explify.sml
@@ -39,6 +39,7 @@ fun explifyKind (k, loc) =
| L.KRecord k => (L'.KRecord (explifyKind k), loc)
| L.KUnit => (L'.KUnit, loc)
+ | L.KTuple _ => raise Fail "Explify KTuple"
| L.KError => raise Fail ("explifyKind: KError at " ^ EM.spanToString loc)
| L.KUnif (_, _, ref (SOME k)) => explifyKind k
@@ -67,6 +68,9 @@ fun explifyCon (c, loc) =
| L.CUnit => (L'.CUnit, loc)
+ | L.CTuple _ => raise Fail "Explify CTuple"
+ | L.CProj _ => raise Fail "Explify CProj"
+
| L.CError => raise Fail ("explifyCon: CError at " ^ EM.spanToString loc)
| L.CUnif (_, _, _, ref (SOME c)) => explifyCon c
| L.CUnif _ => raise Fail ("explifyCon: CUnif at " ^ EM.spanToString loc)
diff --git a/src/main.mlton.sml b/src/main.mlton.sml
index c24cc7c7..e6a973b2 100644
--- a/src/main.mlton.sml
+++ b/src/main.mlton.sml
@@ -25,4 +25,26 @@
* POSSIBILITY OF SUCH DAMAGE.
*)
-val () = Compiler.compile (CommandLine.arguments ())
+fun doArgs (args, (timing, sources)) =
+ case args of
+ [] => (timing, rev sources)
+ | arg :: rest =>
+ let
+ val acc =
+ if size arg > 0 andalso String.sub (arg, 0) = #"-" then
+ case arg of
+ "-timing" => (true, sources)
+ | _ => raise Fail ("Unknown option " ^ arg)
+ else
+ (timing, arg :: sources)
+ in
+ doArgs (rest, acc)
+ end
+
+val (timing, sources) = doArgs (CommandLine.arguments (), (false, []))
+
+val () =
+ if timing then
+ Compiler.time Compiler.toCjrize sources
+ else
+ Compiler.compile sources