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/paths/pathconfig.sml
ViewVC logotype

Diff of /sml/trunk/src/cm/paths/pathconfig.sml

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

revision 367, Sat Jul 3 04:59:01 1999 UTC revision 368, Sat Jul 3 13:05:59 1999 UTC
# Line 12  Line 12 
12    
13      val new : unit -> mode      val new : unit -> mode
14      val set : mode * string * string -> unit      val set : mode * string * string -> unit
15        val cancel : mode * string -> unit
16        val reset : mode -> unit
17    
18      val configAnchor : mode -> string -> (unit -> string) option      val configAnchor : mode -> string -> (unit -> string) option
19    
# Line 28  Line 30 
30      type mode = string StringMap.map ref      type mode = string StringMap.map ref
31    
32      fun set (m, a, s) = m := StringMap.insert (!m, a, s)      fun set (m, a, s) = m := StringMap.insert (!m, a, s)
33        fun reset m = m := StringMap.empty
34        fun cancel (m, a) = (m := #1 (StringMap.remove (!m, a)))
35            handle LibBase.NotFound => ()
36    
37      fun new () = ref (StringMap.empty)      fun new () = ref StringMap.empty
38    
39      fun configAnchor m s =      fun configAnchor m s =
40          case StringMap.find (!m, s) of          case StringMap.find (!m, s) of
# Line 43  Line 48 
48              in              in
49                  if line = "" then ()                  if line = "" then ()
50                  else case String.tokens Char.isSpace line of                  else case String.tokens Char.isSpace line of
51                      [a, d] => (set (m, a, d);                      [a, d] => (set (m, a, d); loop ())
52                                 loop ())                    | ["-"] => (reset m; loop ())
53                    | _ => (Say.say [f, ": malformed line (ignored)\n"];                    | [a] => (cancel (m, a); loop ())
54                            loop ())                    | _ => (Say.say [f, ": malformed line (ignored)\n"]; loop ())
55              end              end
56          in          in
57              loop ()              loop ()

Legend:
Removed from v.367  
changed lines
  Added in v.368

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