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

Diff of /sml/trunk/src/cm/semant/semant.sml

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

revision 732, Mon Nov 13 21:59:12 2000 UTC revision 733, Fri Nov 17 05:13:45 2000 UTC
# Line 193  Line 193 
193              case gth () of              case gth () of
194                  GG.GROUP { kind, sublibs, ... } =>                  GG.GROUP { kind, sublibs, ... } =>
195                  (case kind of                  (case kind of
196                       GG.NOLIB _ => foldl add l sublibs                       GG.NOLIB _ => foldr add l sublibs
197                     | _ => add (x, l))                     | _ => add (x, l))
198                | _ => l                | _ => l
199      in      in
200          foldl oneSG [] subgroups          foldr oneSG [] subgroups
201        end
202    
203        (* Filter out unused stuff and thunkify the group. *)
204        fun filt_th_sgl (sgl, imp_syms) = let
205            (* Add fake "structure <Pervasive>" so that we are sure not to lose
206             * the initgroup when filtering. *)
207            val ss = SymbolSet.add (imp_syms, PervAccess.pervStrSym)
208            fun add ((_, GG.ERRORGROUP, _), l) = l
209              | add ((p, g as GG.GROUP { exports, ... }, rb), l) = let
210                    fun defined_here sy = SymbolMap.inDomain (exports, sy)
211                in
212                    if SymbolSet.exists defined_here ss then
213                        (p, fn () => g, rb) :: l
214                    else l
215                end
216        in
217            foldr add [] sgl
218      end      end
219    
220      fun group arg = let      fun group arg = let
# Line 214  Line 231 
231          in          in
232              #1 (valOf (SymbolMap.find (exports, PervAccess.pervStrSym)))              #1 (valOf (SymbolMap.find (exports, PervAccess.pervStrSym)))
233          end          end
234          val (exports, rp) = MemberCollection.build (mc, filter, gp, pfsbn ())          val (exports, rp, isl) =
235          fun thunkify (p, g, rb) = (p, fn () => g, rb)              MemberCollection.build (mc, filter, gp, pfsbn ())
236          val subgroups = map thunkify (MemberCollection.subgroups mc)          val subgroups = filt_th_sgl (MemberCollection.subgroups mc, isl)
237          val { required = rp', wrapped = wr } = p          val { required = rp', wrapped = wr } = p
238          val rp'' = StringSet.union (rp', StringSet.union (rp, wr))          val rp'' = StringSet.union (rp', StringSet.union (rp, wr))
239      in      in
# Line 244  Line 261 
261          in          in
262              #1 (valOf (SymbolMap.find (exports, PervAccess.pervStrSym)))              #1 (valOf (SymbolMap.find (exports, PervAccess.pervStrSym)))
263          end          end
264          val (exports, rp) = MemberCollection.build (mc, filter, gp, pfsbn ())          val (exports, rp, isl) =
265          fun thunkify (p, g, rb) = (p, fn () => g, rb)              MemberCollection.build (mc, filter, gp, pfsbn ())
266          val subgroups = map thunkify (MemberCollection.subgroups mc)          val subgroups = filt_th_sgl (MemberCollection.subgroups mc, isl)
267          val { required = rp', wrapped = wr } = p          val { required = rp', wrapped = wr } = p
268          val rp'' = StringSet.union (rp', StringSet.union (rp, wr))          val rp'' = StringSet.union (rp', StringSet.union (rp, wr))
269      in      in

Legend:
Removed from v.732  
changed lines
  Added in v.733

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