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 286, Fri May 21 07:47:16 1999 UTC revision 354, Fri Jun 25 08:36:12 1999 UTC
# Line 1  Line 1 
1  (*  (*
2   * The "group registry".  CM uses this to remember which groups it is   * The "group registry".  CM uses this to remember which groups it is
3   * currently working on, and what the corresponding input sources are.   * currently working on and what the corresponding input sources are.
4   *   *
5   * (C) 1999 Lucent Technologies, Bell Laboratories   * (C) 1999 Lucent Technologies, Bell Laboratories
6   *   *
# Line 11  Line 11 
11      type groupreg      type groupreg
12    
13      val new : unit -> groupreg      val new : unit -> groupreg
14      val register : groupreg -> AbsPath.t * GenericVC.Source.inputSource -> unit      val register : groupreg -> SrcPath.t * GenericVC.Source.inputSource -> unit
15      val lookup : groupreg -> AbsPath.t -> GenericVC.Source.inputSource      val lookup : groupreg -> SrcPath.t -> GenericVC.Source.inputSource
16      val registered : groupreg -> AbsPath.t -> bool      val registered : groupreg -> SrcPath.t -> bool
17        val error :
18            groupreg
19            -> SrcPath.t * GenericVC.SourceMap.region
20            -> GenericVC.ErrorMsg.complainer
21  end  end
22    
23  structure GroupReg :> GROUPREG = struct  structure GroupReg :> GROUPREG = struct
24    
25      type groupreg = GenericVC.Source.inputSource AbsPathMap.map ref      type groupreg = GenericVC.Source.inputSource SrcPathMap.map ref
26    
27      fun new () = ref AbsPathMap.empty : groupreg      fun new () = ref SrcPathMap.empty : groupreg
28    
29      fun register gr (g, s) = gr := AbsPathMap.insert (!gr, g, s)      fun register gr (p, s) = gr := SrcPathMap.insert (!gr, p, s)
30      fun lookup gr g = valOf (AbsPathMap.find (!gr, g))      fun lookup gr p = valOf (SrcPathMap.find (!gr, p))
31      fun registered gr g = isSome (AbsPathMap.find (!gr, g))      fun registered gr g = isSome (SrcPathMap.find (!gr, g))
32        fun error gr (g, r) = GenericVC.ErrorMsg.error (lookup gr g) r
33  end  end

Legend:
Removed from v.286  
changed lines
  Added in v.354

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