aboutsummaryrefslogtreecommitdiffhomepage
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
parentb1c0d23525d6a0e8080ce973492c48628c39c717 (diff)
-tc flag
-rw-r--r--doc/manual.tex5
-rw-r--r--src/main.mlton.sml12
2 files changed, 16 insertions, 1 deletions
diff --git a/doc/manual.tex b/doc/manual.tex
index 11d1b2d9..25c5d9b6 100644
--- a/doc/manual.tex
+++ b/doc/manual.tex
@@ -168,6 +168,11 @@ To time how long the different compiler phases run, without generating an execut
urweb -timing P
\end{verbatim}
+To stop the compilation process after type-checking, run
+\begin{verbatim}
+urweb -tc P
+\end{verbatim}
+
Some other command-line parameters are accepted:
\begin{itemize}
\item \texttt{-db <DBSTRING>}: Set database connection information, using the format expected by Postgres's \texttt{PQconnectdb()}, which is \texttt{name1=value1 ... nameN=valueN}. The same format is also parsed and used to discover connection parameters for MySQL and SQLite. The only significant settings for MySQL are \texttt{host}, \texttt{hostaddr}, \texttt{port}, \texttt{dbname}, \texttt{user}, and \texttt{password}. The only significant setting for SQLite is \texttt{dbname}, which is interpreted as the filesystem path to the database. Additionally, when using SQLite, a database string may be just a file path.
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