CVS: sml-dist/src/cm/semant group-reg.sml,1.10,1.11 members.sml,1.60,1.61 semant.sml,1.56,1.57

Matthias Blume <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj.commits
Message-ID <[email protected]>
Update of /cvsroot/smlnj/sml-dist/src/cm/semant
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19679/src/cm/semant

Modified Files:
	group-reg.sml members.sml semant.sml 
Log Message:
improved error handling in CM

Index: group-reg.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/cm/semant/group-reg.sml,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** group-reg.sml	19 Jul 2001 18:59:33 -0000	1.10
--- group-reg.sml	16 Dec 2005 06:13:13 -0000	1.11
***************
*** 18,21 ****
--- 18,22 ----
      val error : groupreg ->
  		SrcPath.file * SourceMap.region -> ErrorMsg.complainer
+     val anyErrors : groupreg -> SrcPath.file -> bool
  end
  
***************
*** 27,33 ****
  
      fun register gr (p, s) = gr := SrcPathMap.insert (!gr, p, s)
!     fun lookup gr p = valOf (SrcPathMap.find (!gr, p))
! 	handle Option => raise Fail ("GroupReg.lookup " ^ SrcPath.descr p)
      fun registered gr g = isSome (SrcPathMap.find (!gr, g))
      fun error gr (g, r) = ErrorMsg.error (lookup gr g) r
  end
--- 28,37 ----
  
      fun register gr (p, s) = gr := SrcPathMap.insert (!gr, p, s)
!     fun lookup gr p =
! 	case SrcPathMap.find (!gr, p) of
! 	    SOME s => s
! 	  | NONE => raise Fail ("GroupReg.lookup " ^ SrcPath.descr p)
      fun registered gr g = isSome (SrcPathMap.find (!gr, g))
      fun error gr (g, r) = ErrorMsg.error (lookup gr g) r
+     fun anyErrors gr g = !(#anyErrors (lookup gr g : Source.inputSource))
  end

Index: members.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/cm/semant/members.sml,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** members.sml	27 Sep 2004 22:18:07 -0000	1.60
--- members.sml	16 Dec 2005 06:13:13 -0000	1.61
***************
*** 41,45 ****
  
      val build :
! 	collection * SymbolSet.set * GeneralParams.info *
  	DependencyGraph.farsbnode	(* pervasive env *)
  	-> impexp SymbolMap.map * GroupGraph.privileges * SymbolSet.set
--- 41,45 ----
  
      val build :
! 	SrcPath.file * collection * SymbolSet.set * GeneralParams.info *
  	DependencyGraph.farsbnode	(* pervasive env *)
  	-> impexp SymbolMap.map * GroupGraph.privileges * SymbolSet.set
***************
*** 164,168 ****
  			 reqpriv = StringSet.union (#reqpriv c1, #reqpriv c2) }
  	end
!       | sequential _ = ERRORCOLLECTION
  
      fun expandOne { gp, rparse, load_plugin } arg = let
--- 164,169 ----
  			 reqpriv = StringSet.union (#reqpriv c1, #reqpriv c2) }
  	end
!       | sequential (ERRORCOLLECTION, _, _) = ERRORCOLLECTION
!       | sequential (_, ERRORCOLLECTION, _) = ERRORCOLLECTION
  
      fun expandOne { gp, rparse, load_plugin } arg = let
***************
*** 228,232 ****
  		    NONE => SS.empty
  		  | SOME ex => (if SS.isEmpty ex then
! 				    w0 ("no module exports from " ^
  					SrcPath.descr p)
  				else ();
--- 229,233 ----
  		    NONE => SS.empty
  		  | SOME ex => (if SS.isEmpty ex then
! 				    e0 ("no module exports from " ^
  					SrcPath.descr p)
  				else ();
***************
*** 234,244 ****
  	    fun addLD (s, m) = SM.insert (m, s, i)
  	    val ld = SS.foldl addLD SM.empty exports
! 	in
! 	    COLLECTION { imports = SM.empty,
! 			 smlfiles = [(i, exports)],
! 			 localdefs = ld,
! 			 subgroups = [],
! 			 sources = SrcPathMap.empty,
! 			 reqpriv = StringSet.empty }
  	end
  	val collections = map g_coll cmfiles @ map s_coll smlfiles
--- 235,245 ----
  	    fun addLD (s, m) = SM.insert (m, s, i)
  	    val ld = SS.foldl addLD SM.empty exports
! 	in if SS.isEmpty exports then ERRORCOLLECTION
! 	   else COLLECTION { imports = SM.empty,
! 			     smlfiles = [(i, exports)],
! 			     localdefs = ld,
! 			     subgroups = [],
! 			     sources = SrcPathMap.empty,
! 			     reqpriv = StringSet.empty }
  	end
  	val collections = map g_coll cmfiles @ map s_coll smlfiles
***************
*** 248,255 ****
      end
  
!     fun build (COLLECTION c, filter, gp, perv_fsbnode) =
! 	BuildDepend.build (c, filter, gp, perv_fsbnode)
!       | build (ERRORCOLLECTION, _, _, _) =
! 	(SM.empty, StringSet.empty, SS.empty)
  
      fun mkIndex (gp, g, COLLECTION c) = Index.mkIndex (gp, g, c)
--- 249,258 ----
      end
  
!     fun build (g, COLLECTION c, filter, gp, perv_fsbnode) =
! 	  if GroupReg.anyErrors (#groupreg gp) g then
! 	      (SM.empty, StringSet.empty, SS.empty)
! 	  else BuildDepend.build (c, filter, gp, perv_fsbnode)
!       | build (_, ERRORCOLLECTION, _, _, _) =
! 	  (SM.empty, StringSet.empty, SS.empty)
  
      fun mkIndex (gp, g, COLLECTION c) = Index.mkIndex (gp, g, c)

Index: semant.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/cm/semant/semant.sml,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** semant.sml	18 Oct 2004 21:45:24 -0000	1.56
--- semant.sml	16 Dec 2005 06:13:13 -0000	1.57
***************
*** 260,264 ****
  	val _ = MC.mkIndex (gp, g, mc)
  	val (exports, rp, isl) =
! 	    MC.build (mc, filter, gp, pfsbn ())
  	val subgroups = filt_th_sgl (MC.subgroups mc, isl)
  	val { required = rp', wrapped = wr } = p
--- 260,264 ----
  	val _ = MC.mkIndex (gp, g, mc)
  	val (exports, rp, isl) =
! 	    MC.build (g, mc, filter, gp, pfsbn ())
  	val subgroups = filt_th_sgl (MC.subgroups mc, isl)
  	val { required = rp', wrapped = wr } = p
***************
*** 291,295 ****
  	val _ = MC.mkIndex (gp, g, mc)
  	val (exports, rp, isl) =
! 	    MC.build (mc, filter, gp, pfsbn ())
  	val subgroups = filt_th_sgl (MC.subgroups mc, isl)
  	val { required = rp', wrapped = wr } = p
--- 291,295 ----
  	val _ = MC.mkIndex (gp, g, mc)
  	val (exports, rp, isl) =
! 	    MC.build (g, mc, filter, gp, pfsbn ())
  	val subgroups = filt_th_sgl (MC.subgroups mc, isl)
  	val { required = rp', wrapped = wr } = p



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.