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

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

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

revision 735, Tue Nov 21 12:15:55 2000 UTC revision 736, Thu Nov 23 01:39:05 2000 UTC
# Line 208  Line 208 
208              else if a = "." then dot              else if a = "." then dot
209              else if a = ".." then dotdot              else if a = ".." then dotdot
210              else ta a              else ta a
211          fun e_p (PATH { arcs, context, ... }, ctxt, a) =          fun e_p (PATH { arcs = [], context, ... }, _, a) =
212              let val l = rev arcs              e_c (context, a, NONE)
213                  val l = if ctxt andalso bracket then            | e_p (PATH { arcs, context, ... }, ctxt, a) =
214                              concat ["(", List.hd l, ")"] :: List.tl l              let val l = map arc arcs
215                          else l                  val a0 = List.hd l
216                  val a = case l of                  val l' = rev l
217                              [] => a                  val l'' = if ctxt andalso bracket then
218                            | h :: t =>                                concat ["(", List.hd l', ")"] :: List.tl l'
219                              foldl (fn (x, l) => arc x :: "/" :: l)                          else l'
220                                    (arc h :: a) t                  val a' = foldl (fn (x, l) => arc x :: "/" :: l)
221              in e_c (context, a)                                (arc (List.hd l'') :: a) (List.tl l'')
222                in e_c (context, a', SOME a0)
223              end              end
224          and e_c (ROOT "", a) = concat ("/" :: a)          and e_c (ROOT "", a, _) = concat ("/" :: a)
225            | e_c (ROOT vol, a) = concat ("%" :: ta vol :: "/" :: a)            | e_c (ROOT vol, a, _) = concat ("%" :: ta vol :: "/" :: a)
226            | e_c (CWD _, a) = concat a            | e_c (CWD _, a, _) = concat a
227            | e_c (ANCHOR x, a) = concat ("$" :: ta (#name x) :: "/" :: a)            | e_c (ANCHOR x, a, NONE) = concat ("$" :: ta (#name x) :: "/" :: a)
228            | e_c (DIR p, a) = e_p (p, true, ":" :: a)            | e_c (ANCHOR x, a, SOME a1) = let
229                    val a0 = ta (#name x)
230                in
231                    concat (if bracket andalso a0 = a1 then "$/" :: a
232                            else "$" :: a0 :: "/" :: a)
233                end
234              | e_c (DIR p, a, _) = e_p (p, true, ":" :: a)
235      in      in
236          e_p (p, false, [])          e_p (p, false, [])
237      end      end

Legend:
Removed from v.735  
changed lines
  Added in v.736

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