diff src/compiler.sml @ 834:74e9e7642f08

Do 'open constraints' automatically; fix sourceless <cselect> monoize bug; Monad library module
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Jun 2009 11:50:53 -0400
parents 249740301a0a
children 19fdeef40ada
line wrap: on
line diff
--- a/src/compiler.sml	Sun May 31 15:25:27 2009 -0400
+++ b/src/compiler.sml	Tue Jun 02 11:50:53 2009 -0400
@@ -589,6 +589,8 @@
 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 sgn = (Source.SgnConst (#func parseUrs urs), loc)
                       in
+                          checkErrors ();
                           (Source.DFfiStr (mname, sgn), loc)
                       end
 
@@ -617,6 +620,7 @@
                                         {file = urs,
                                          first = ErrorMsg.dummyPos,
                                          last = ErrorMsg.dummyPos})
+                                  before checkErrors ()
                               else
                                   NONE
 
@@ -626,12 +630,18 @@
 
                           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)