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 536, Fri Feb 18 16:51:54 2000 UTC revision 537, Fri Feb 18 17:20:16 2000 UTC
# Line 38  Line 38 
38      val emptyGroup : pathname -> group      val emptyGroup : pathname -> group
39      val group :      val group :
40          pathname * privilegespec * exports option * members *          pathname * privilegespec * exports option * members *
41          GeneralParams.info * pathname option * pathname option * complainer          GeneralParams.info * pathname option * pathname option * complainer *
42            GroupGraph.group                (* init group *)
43          -> group          -> group
44      val library :      val library :
45          pathname * privilegespec * exports * members *          pathname * privilegespec * exports * members *
46          GeneralParams.info          GeneralParams.info *
47            GroupGraph.group                (* init group *)
48          -> group          -> group
49    
50      (* assembling privilege lists *)      (* assembling privilege lists *)
# Line 144  Line 146 
146    
147      fun emptyGroup path =      fun emptyGroup path =
148          GG.GROUP { exports = SymbolMap.empty,          GG.GROUP { exports = SymbolMap.empty,
149                     kind = GG.NOLIB,                     kind = GG.NOLIB [],
150                     required = StringSet.empty,                     required = StringSet.empty,
151                     grouppath = path,                     grouppath = path,
152                     sublibs = [] }                     sublibs = [] }
# Line 155  Line 157 
157              if List.exists (sameSL x) l then l else x :: l              if List.exists (sameSL x) l then l else x :: l
158          fun oneSG (x as (_, GG.GROUP { kind, sublibs, ... }), l) =          fun oneSG (x as (_, GG.GROUP { kind, sublibs, ... }), l) =
159              case kind of              case kind of
160                  GG.NOLIB => foldl add l sublibs                  GG.NOLIB _ => foldl add l sublibs
161                | _ => add (x, l)                | _ => add (x, l)
162      in      in
163          foldl oneSG [] subgroups          foldl oneSG [] subgroups
164      end      end
165    
166      fun grouplib (islib, g, p, e, m, gp, curlib) = let      fun grouplib (islib, g, p, e, m, gp, curlib, init_group) = let
167          val mc = applyTo (MemberCollection.empty, curlib) m          val mc = applyTo (MemberCollection.implicit init_group, curlib) m
168          val filter = Option.map (applyTo mc) e          val filter = Option.map (applyTo mc) e
169          val (exports, rp) = MemberCollection.build (mc, filter, gp)          val pfsbn = let
170                val GroupGraph.GROUP { exports, ... } = init_group
171            in
172                #1 (valOf (SymbolMap.find (exports, PervCoreAccess.pervStrSym)))
173            end
174            val (exports, rp) = MemberCollection.build (mc, filter, gp, pfsbn)
175          val subgroups = MemberCollection.subgroups mc          val subgroups = MemberCollection.subgroups mc
176          val { required = rp', wrapped = wr } = p          val { required = rp', wrapped = wr } = p
177          val rp'' = StringSet.union (rp', StringSet.union (rp, wr))          val rp'' = StringSet.union (rp', StringSet.union (rp, wr))
178      in      in
179          GG.GROUP { exports = exports,          GG.GROUP { exports = exports,
180                     kind = if islib then GG.LIB wr                     kind = if islib then GG.LIB (wr, subgroups)
181                            else (if StringSet.isEmpty wr then ()                            else (if StringSet.isEmpty wr then ()
182                                  else EM.impossible                                  else EM.impossible
183                                      "group with wrapped privilege";                                      "group with wrapped privilege";
184                                  GG.NOLIB),                                  GG.NOLIB subgroups),
185                     required = rp'',                     required = rp'',
186                     grouppath = g,                     grouppath = g,
187                     sublibs = sgl2sll subgroups }                     sublibs = sgl2sll subgroups }
188      end      end
189    
190      fun group (g, p, e, m, gp, curlib, owner, error) = let      fun group (g, p, e, m, gp, curlib, owner, error, init_group) = let
191          fun libname NONE = "<toplevel>"          fun libname NONE = "<toplevel>"
192            | libname (SOME p) = SrcPath.descr p            | libname (SOME p) = SrcPath.descr p
193          fun eq (NONE, NONE) = true          fun eq (NONE, NONE) = true
# Line 193  Line 200 
200                                  libname curlib])                                  libname curlib])
201      in      in
202          checkowner ();          checkowner ();
203          grouplib (false, g, p, e, m, gp, curlib)          grouplib (false, g, p, e, m, gp, curlib, init_group)
204      end      end
205      fun library (g, p, e, m, gp) =      fun library (g, p, e, m, gp, init_group) =
206          grouplib (true, g, p, SOME e, m, gp, SOME g)          grouplib (true, g, p, SOME e, m, gp, SOME g, init_group)
207    
208      local      local
209          val isMember = StringSet.member          val isMember = StringSet.member

Legend:
Removed from v.536  
changed lines
  Added in v.537

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