changeset 1086:99aebdf30257

-tc flag
author Adam Chlipala <adamc@hcoop.net>
date Thu, 24 Dec 2009 10:02:48 -0500 (2009-12-24)
parents ae885ad70d83
children e81434513720
files doc/manual.tex src/main.mlton.sml
diffstat 2 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/doc/manual.tex	Thu Dec 24 09:56:09 2009 -0500
+++ b/doc/manual.tex	Thu Dec 24 10:02:48 2009 -0500
@@ -168,6 +168,11 @@
 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.
--- a/src/main.mlton.sml	Thu Dec 24 09:56:09 2009 -0500
+++ b/src/main.mlton.sml	Thu Dec 24 10:02:48 2009 -0500
@@ -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 @@
       | "-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 @@
         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