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/branches/primop-branch-2/src/compiler/ElabData/modules/moduleutil.sml
ViewVC logotype

Diff of /sml/branches/primop-branch-2/src/compiler/ElabData/modules/moduleutil.sml

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

revision 1968, Tue Jul 11 15:10:15 2006 UTC revision 1969, Tue Jul 11 15:35:49 2006 UTC
# Line 175  Line 175 
175  fun strDefToStr(CONSTstrDef str, _) = str  fun strDefToStr(CONSTstrDef str, _) = str
176    | strDefToStr(VARstrDef(sign,entPath), entEnv) =    | strDefToStr(VARstrDef(sign,entPath), entEnv) =
177      STR{sign=sign,rlzn=EE.lookStrEP(entEnv,entPath),      STR{sign=sign,rlzn=EE.lookStrEP(entEnv,entPath),
178          access=A.nullAcc, prim=POI.StrE []}          access=A.nullAcc, prim=[]}
179    
180  (*  (*
181   * two pieces of essential structure information gathered during   * two pieces of essential structure information gathered during
# Line 183  Line 183 
183   * being searched is a STRSIG; otherwise it return STRINFO.   * being searched is a STRSIG; otherwise it return STRINFO.
184   *)   *)
185  datatype strInfo = SIGINFO of EP.entPath  (* reverse order! *)  datatype strInfo = SIGINFO of EP.entPath  (* reverse order! *)
186                   | STRINFO of strEntity * A.access * POI.strPrimElem                   | STRINFO of strEntity * A.access * POI.strPrimInfo
187    
188  val bogusInfo = STRINFO (bogusStrEntity, A.nullAcc, POI.StrE [])  val bogusInfo = STRINFO (bogusStrEntity, A.nullAcc, [])
189    
190  fun getStrElem (sym, sign as SIG {elements,...}, sInfo) =  fun getStrElem (sym, sign as SIG {elements,...}, sInfo) =
191        (case getSpec (elements,sym)        (case getSpec (elements,sym)
# Line 451  Line 451 
451    
452  (** strPrimElemInBinds  (** strPrimElemInBinds
453    
454      Get a strPrimElem with all the primIds found in a list of bindings      Get a strPrimElem list with all the primIds found in a list of bindings
455      (including those in nested structures)      (including those in nested structures)
456    
457      Used in Elaborator/elaborate/elabmod.sml and      Used in Elaborator/elaborate/elabmod.sml and
458      SigMatch      SigMatch
459   *)   *)
460  fun strPrimElemInBinds [] = POI.StrE []  fun strPrimElemInBinds (bindings) =
   | strPrimElemInBinds (bind::rest) =  
461      let      let
462          val strPrims =          fun strPrims bind =
463             (case bind             (case bind
464               of B.STRbind (M.STR { prim, ... }) => prim               of B.STRbind (M.STR { prim, ... }) => POI.StrE prim
465                | B.FCTbind (M.FCT { prim, ... }) => prim                | B.FCTbind (M.FCT { prim, ... }) => POI.StrE prim
466                | B.VALbind (V.VALvar {prim, ...}) => POI.PrimE prim                | B.VALbind (V.VALvar {prim, ...}) => POI.PrimE prim
467                | B.CONbind _ => POI.PrimE POI.NonPrim (* still fishy *)                | B.CONbind _ => POI.PrimE POI.NonPrim (* still fishy *)
468                                   (* GK: Doesn't this throw off the slot number
469                                      correspondence because CONbinds may
470                                      or may not have a corresponding slot
471                                      number (Data cons do not and Exception
472                                      cons do) *)
473                | _  =>                | _  =>
474                    bug "unexpected binding in strPrimElemInBinds")                    bug "unexpected binding in strPrimElemInBinds")
475      in      in
476         (case (strPrimElemInBinds rest) of          map strPrims bindings
             (POI.StrE restPrims) =>  
               POI.StrE (strPrims :: restPrims)  
           | POI.PrimE id => POI.StrE ([POI.PrimE id]))  
477      end (* let *)      end (* let *)
478    
479  (* extract all signature names from a structure --  (* extract all signature names from a structure --

Legend:
Removed from v.1968  
changed lines
  Added in v.1969

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