Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/semant/group-reg.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/semant/group-reg.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1878, Mon Nov 21 19:54:57 2005 UTC revision 1879, Fri Dec 16 06:13:13 2005 UTC
# Line 17  Line 17 
17      val registered : groupreg -> SrcPath.file -> bool      val registered : groupreg -> SrcPath.file -> bool
18      val error : groupreg ->      val error : groupreg ->
19                  SrcPath.file * SourceMap.region -> ErrorMsg.complainer                  SrcPath.file * SourceMap.region -> ErrorMsg.complainer
20        val anyErrors : groupreg -> SrcPath.file -> bool
21  end  end
22    
23  structure GroupReg :> GROUPREG = struct  structure GroupReg :> GROUPREG = struct
# Line 26  Line 27 
27      fun new () = ref SrcPathMap.empty : groupreg      fun new () = ref SrcPathMap.empty : groupreg
28    
29      fun register gr (p, s) = gr := SrcPathMap.insert (!gr, p, s)      fun register gr (p, s) = gr := SrcPathMap.insert (!gr, p, s)
30      fun lookup gr p = valOf (SrcPathMap.find (!gr, p))      fun lookup gr p =
31          handle Option => raise Fail ("GroupReg.lookup " ^ SrcPath.descr p)          case SrcPathMap.find (!gr, p) of
32                SOME s => s
33              | NONE => raise Fail ("GroupReg.lookup " ^ SrcPath.descr p)
34      fun registered gr g = isSome (SrcPathMap.find (!gr, g))      fun registered gr g = isSome (SrcPathMap.find (!gr, g))
35      fun error gr (g, r) = ErrorMsg.error (lookup gr g) r      fun error gr (g, r) = ErrorMsg.error (lookup gr g) r
36        fun anyErrors gr g = !(#anyErrors (lookup gr g : Source.inputSource))
37  end  end

Legend:
Removed from v.1878  
changed lines
  Added in v.1879

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0