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

Diff of /sml/trunk/src/cm/semant/members.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 20  Line 20 
20    
21      val empty : collection      val empty : collection
22    
23        val implicit : GroupGraph.group -> collection
24    
25      val expandOne :      val expandOne :
26          GeneralParams.info * (SrcPath.t -> GroupGraph.group) * (string -> bool)          GeneralParams.info * (SrcPath.t -> GroupGraph.group) * (string -> bool)
27          -> { name: string, mkpath: string -> SrcPath.t,          -> { name: string, mkpath: string -> SrcPath.t,
# Line 29  Line 31 
31      val sequential : collection * collection * (string -> unit) -> collection      val sequential : collection * collection * (string -> unit) -> collection
32    
33      val build :      val build :
34          collection * SymbolSet.set option * GeneralParams.info          collection * SymbolSet.set option * GeneralParams.info *
35            DependencyGraph.farsbnode       (* pervasive env *)
36          -> impexp SymbolMap.map * GroupGraph.privileges          -> impexp SymbolMap.map * GroupGraph.privileges
37    
38      val subgroups : collection -> (SrcPath.t * GroupGraph.group) list      val subgroups : collection -> (SrcPath.t * GroupGraph.group) list
# Line 69  Line 72 
72                       subgroups = [],                       subgroups = [],
73                       reqpriv = StringSet.empty }                       reqpriv = StringSet.empty }
74    
75        fun implicit init_group = let
76            val (GG.GROUP { grouppath, ... }) = init_group
77        in
78            (* This is a collection that is an implicit member of every
79             * library -- the "init" group which exports the pervasive env. *)
80            COLLECTION { imports = SymbolMap.empty,
81                         gimports = SymbolMap.empty,
82                         smlfiles = [],
83                         localdefs = SymbolMap.empty,
84                         subgroups = [(grouppath, init_group)],
85                         reqpriv = StringSet.empty }
86        end
87    
88      fun sequential (COLLECTION c1, COLLECTION c2, error) = let      fun sequential (COLLECTION c1, COLLECTION c2, error) = let
89          fun describeSymbol (s, r) = let          fun describeSymbol (s, r) = let
90              val ns = Symbol.nameSpace s              val ns = Symbol.nameSpace s
# Line 106  Line 122 
122      end      end
123    
124      fun expandOne (gp, rparse, load_plugin) arg = let      fun expandOne (gp, rparse, load_plugin) arg = let
         val primconf = #primconf (#param gp)  
125          val { name, mkpath, group, class, context } = arg          val { name, mkpath, group, class, context } = arg
126          val class = Option.map (String.map Char.toLower) class          val class = Option.map (String.map Char.toLower) class
127          val error = GroupReg.error (#groupreg gp) group          val error = GroupReg.error (#groupreg gp) group
         fun noPrimitive () = let  
128              fun e0 s = error EM.COMPLAIN s EM.nullErrorBody              fun e0 s = error EM.COMPLAIN s EM.nullErrorBody
129              fun w0 s = error EM.WARN s EM.nullErrorBody              fun w0 s = error EM.WARN s EM.nullErrorBody
130              val { smlfiles, cmfiles } =              val { smlfiles, cmfiles } =
# Line 119  Line 133 
133                                        context = context,                                        context = context,
134                                        load_plugin = load_plugin }                                        load_plugin = load_plugin }
135              fun g_coll p = let              fun g_coll p = let
136                  val g as GG.GROUP { exports = i, kind, required, ... } =              val g as GG.GROUP { exports = i, kind, required, ... } = rparse p
137                      rparse p              val gi = case kind of GG.NOLIB _ => i | _ => SymbolMap.empty
                 val gi = case kind of GG.NOLIB => i | _ => SymbolMap.empty  
138              in              in
139                  COLLECTION { imports = i, gimports = gi, smlfiles = [],                  COLLECTION { imports = i, gimports = gi, smlfiles = [],
140                               localdefs = SymbolMap.empty,                               localdefs = SymbolMap.empty,
# Line 129  Line 142 
142                               reqpriv = required }                               reqpriv = required }
143              end              end
144              fun s_coll (p, s) = let              fun s_coll (p, s) = let
145                  val i = SmlInfo.info gp              val i =
146                      { sourcepath = p, group = group,                  SmlInfo.info gp { sourcepath = p, group = group, sh_spec = s }
                       sh_spec = s, split = true }  
147                  val exports =                  val exports =
148                      case SmlInfo.exports gp i of                      case SmlInfo.exports gp i of
149                          NONE => SS.empty                          NONE => SS.empty
# Line 155  Line 167 
167          in          in
168              foldl combine empty collections              foldl combine empty collections
169          end          end
     in  
         if isSome class then noPrimitive ()  
         else case Primitive.fromString primconf name of  
             SOME p => let  
                 val exports = Primitive.exports primconf p  
                 val env = Primitive.da_env primconf p  
                 fun addFN (s, m) = let  
                     val ii = Primitive.iinfo primconf p  
                     val fsbn = (NONE, DG.SB_BNODE (DG.PNODE p, ii))  
                 in  
                     SymbolMap.insert (m, s, (fsbn, env))  
                 end  
                 val imp = SS.foldl addFN SymbolMap.empty exports  
             in  
                 COLLECTION { imports = imp,  
                              gimports = SymbolMap.empty,  
                              smlfiles = [],  
                              localdefs = SymbolMap.empty,  
                              subgroups = [],  
                              reqpriv = Primitive.reqpriv p }  
             end  
           | NONE => noPrimitive ()  
     end  
170    
171      fun build (COLLECTION c, fopt, gp) =      fun build (COLLECTION c, fopt, gp, perv_fsbnode) =
172          BuildDepend.build (c, fopt, gp)          BuildDepend.build (c, fopt, gp, perv_fsbnode)
173    
174      fun subgroups (COLLECTION { subgroups = sg, ... }) = sg      fun subgroups (COLLECTION { subgroups = sg, ... }) = sg
175    

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