summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-06-02 11:50:53 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-06-02 11:50:53 -0400
commit67d67ecae2fdb8708e6207db04880d89d43ba1cb (patch)
tree4cbf52d1978e57eba75d8fbbb9091394c67d0a6a /src/compiler.sml
parent97570513feb954bc3845f349700f1117fd50ca4b (diff)
Do 'open constraints' automatically; fix sourceless <cselect> monoize bug; Monad library module
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index fb5ed0e0..4209426f 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -589,6 +589,8 @@ fun capitalize "" = ""
val parse = {
func = fn {database, sources = fnames, ffi, ...} : job =>
let
+ val anyErrors = ref false
+ fun checkErrors () = anyErrors := (!anyErrors orelse ErrorMsg.anyErrors ())
fun nameOf fname = capitalize (OS.Path.file fname)
fun parseFfi fname =
@@ -602,6 +604,7 @@ val parse = {
val sgn = (Source.SgnConst (#func parseUrs urs), loc)
in
+ checkErrors ();
(Source.DFfiStr (mname, sgn), loc)
end
@@ -617,6 +620,7 @@ val parse = {
{file = urs,
first = ErrorMsg.dummyPos,
last = ErrorMsg.dummyPos})
+ before checkErrors ()
else
NONE
@@ -626,12 +630,18 @@ val parse = {
val ds = #func parseUr ur
in
+ checkErrors ();
(Source.DStr (mname, sgnO, (Source.StrConst ds, loc)), loc)
end
val dsFfi = map parseFfi ffi
val ds = map parseOne fnames
in
+ if !anyErrors then
+ ErrorMsg.error "Parse failure"
+ else
+ ();
+
let
val final = nameOf (List.last fnames)