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

Diff of /sml/trunk/src/cm/depend/reachable.sml

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

revision 450, Fri Oct 22 17:10:09 1999 UTC revision 451, Sat Oct 23 15:05:55 1999 UTC
# Line 35  Line 35 
35              SymbolMap.foldl impexp empty exports              SymbolMap.foldl impexp empty exports
36          end          end
37    
38          val snodeMap' =          fun snodeMap' (exports, acc) =
39              reach { add = SrcPathMap.insert,              reach { add = SrcPathMap.insert,
40                      member = SrcPathMap.inDomain,                      member = SrcPathMap.inDomain,
41                      empty = SrcPathMap.empty }                      empty = acc } exports
42      in      in
43          val reachable' =          val reachable' =
44              reach { add = fn (s, x, _) => SrcPathSet.add (s, x),              reach { add = fn (s, x, _) => SrcPathSet.add (s, x),
# Line 47  Line 47 
47    
48          fun reachable (GroupGraph.GROUP { exports, ... }) = reachable' exports          fun reachable (GroupGraph.GROUP { exports, ... }) = reachable' exports
49    
50          fun snodeMap (GroupGraph.GROUP { exports, ... }) = snodeMap' exports          fun snodeMap g = let
51                fun snm (g, (a, seen)) = let
52                    val GroupGraph.GROUP { exports, sublibs, grouppath, ... } = g
53                in
54                    if SrcPathSet.member (seen, grouppath) then (a, seen)
55                    else foldl (fn ((_, g), x) => snm (g, x))
56                               (snodeMap' (exports, a),
57                                SrcPathSet.add (seen, grouppath))
58                               sublibs
59                end
60            in
61                #1 (snm (g, (SrcPathMap.empty, SrcPathSet.empty)))
62            end
63      end      end
64  end  end

Legend:
Removed from v.450  
changed lines
  Added in v.451

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