diff options
-rw-r--r-- | doc/manual.tex | 5 | ||||
-rw-r--r-- | src/main.mlton.sml | 12 |
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 |