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

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

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

revision 310, Wed Jun 2 07:28:27 1999 UTC revision 318, Mon Jun 7 09:32:09 1999 UTC
# Line 15  Line 15 
15      val newEra : unit -> unit      val newEra : unit -> unit
16    
17      val cwdContext: unit -> context      val cwdContext: unit -> context
18      val configContext: (unit -> string) * string -> context      (* val configContext: (unit -> string) * string -> context *)
19      val relativeContext: t -> context      val relativeContext: t -> context
20    
21      val name : t -> string      val name : t -> string
# Line 25  Line 25 
25      val contextName : context -> string      val contextName : context -> string
26    
27      val native : { context: context, spec: string } -> t      val native : { context: context, spec: string } -> t
28      val standard : { context: context, spec: string } -> t      val standard : PathConfig.mode -> { context: context, spec: string } -> t
29    
30      val pickle : t -> string list      val pickle : t -> string list
31      val unpickle : string list -> t option      val unpickle : PathConfig.mode -> string list -> t option
32    
33      val joinDirFile : { dir: t, file: string } -> t      val joinDirFile : { dir: t, file: string } -> t
34      val splitDirFile : t -> { dir: t, file: string }      val splitDirFile : t -> { dir: t, file: string }
# Line 209  Line 209 
209          fun native { spec, context } = fresh (context, spec)          fun native { spec, context } = fresh (context, spec)
210    
211          (* make an abstract path from a standard string *)          (* make an abstract path from a standard string *)
212          fun standard { spec, context } = let          fun standard mode { spec, context } = let
213              fun delim #"/" = true              fun delim #"/" = true
214                | delim #"\\" = true              (* accept DOS-style, too *)                | delim #"\\" = true              (* accept DOS-style, too *)
215                | delim _ = false                | delim _ = false
# Line 227  Line 227 
227                  "" :: arcs => mk (true, arcs, context)                  "" :: arcs => mk (true, arcs, context)
228                | [] => mk (false, [], context) (* shouldn't happen *)                | [] => mk (false, [], context) (* shouldn't happen *)
229                | arcs as (arc1 :: _) =>                | arcs as (arc1 :: _) =>
230                      (case PathConfig.configAnchor arc1 of                      (case PathConfig.configAnchor mode arc1 of
231                           NONE => mk (false, arcs, context)                           NONE => mk (false, arcs, context)
232                         | SOME fetch => let                         | SOME fetch => let
233                               val anchorcontext =                               val anchorcontext =
# Line 249  Line 249 
249              p_p p              p_p p
250          end          end
251    
252          fun unpickle l = let          fun unpickle mode l = let
253              exception Format              exception Format
254              fun u_p (h :: t) =              fun u_p (h :: t) =
255                  PATH { context = u_c t, spec = h, cache = ref NONE }                  PATH { context = u_c t, spec = h, cache = ref NONE }
256                | u_p [] = raise Format                | u_p [] = raise Format
257              and u_c ["c"] = cwdContext ()              and u_c ["c"] = cwdContext ()
258                | u_c [n, "a"] =                | u_c [n, "a"] =
259                  (case PathConfig.configAnchor n of                  (case PathConfig.configAnchor mode n of
260                       NONE => raise Format                       NONE => raise Format
261                     | SOME fetch => CONFIG_ANCHOR { fetch = fetch,                     | SOME fetch => CONFIG_ANCHOR { fetch = fetch,
262                                                     cache = ref NONE,                                                     cache = ref NONE,

Legend:
Removed from v.310  
changed lines
  Added in v.318

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