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

Diff of /sml/trunk/src/cm/smlfile/smlinfo.sml

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

revision 329, Fri Jun 11 09:53:10 1999 UTC revision 330, Sat Jun 12 07:45:52 1999 UTC
# Line 126  Line 126 
126          knownInfo := AbsPathMap.filteri isReachable (!knownInfo)          knownInfo := AbsPathMap.filteri isReachable (!knownInfo)
127      end      end
128    
129        (* check timestamp and throw away any invalid cache *)
130        fun validate (sourcepath, PERS pir) = let
131            (* don't use "..." pattern to have the compiler catch later
132             * additions to the type! *)
133            val { group, lastseen, parsetree, skeleton } = pir
134            val ts = !lastseen
135            val nts = AbsPath.tstamp sourcepath
136        in
137            if TStamp.earlier (ts, nts) then
138                (lastseen := nts;
139                 parsetree := NONE;
140                 skeleton := NONE)
141            else ()
142        end
143    
144      fun info (gp: GeneralParams.info) arg = let      fun info (gp: GeneralParams.info) arg = let
145          val { sourcepath, group = gr as (group, region), share, split } = arg          val { sourcepath, group = gr as (group, region), share, split } = arg
146          val policy = #fnpolicy (#param gp)          val policy = #fnpolicy (#param gp)
# Line 133  Line 148 
148          val binpath = FNP.mkBinPath policy sourcepath          val binpath = FNP.mkBinPath policy sourcepath
149          val groupreg = #groupreg gp          val groupreg = #groupreg gp
150          fun newpersinfo () = let          fun newpersinfo () = let
151              val pi = PERS { group = gr, lastseen = ref TStamp.NOTSTAMP,              val ts = AbsPath.tstamp sourcepath
152                val pi = PERS { group = gr, lastseen = ref ts,
153                              parsetree = ref NONE, skeleton = ref NONE }                              parsetree = ref NONE, skeleton = ref NONE }
154          in          in
155              knownInfo := AbsPathMap.insert (!knownInfo, sourcepath, pi);              knownInfo := AbsPathMap.insert (!knownInfo, sourcepath, pi);
# Line 161  Line 177 
177                                  EM.nullErrorBody;                                  EM.nullErrorBody;
178                          newpersinfo ()                          newpersinfo ()
179                      end                      end
180                      else pi                      else (validate (sourcepath, pi); pi)
181      in      in
182          INFO { sourcepath = sourcepath,          INFO { sourcepath = sourcepath,
183                 skelpath = skelpath,                 skelpath = skelpath,
# Line 171  Line 187 
187                 split = split }                 split = split }
188      end      end
189    
     (* check timestamp and throw away any invalid cache *)  
     fun validate (INFO ir) = let  
         (* don't use "..." pattern to have the compiler catch later  
          * additions to the type! *)  
         val { sourcepath, skelpath, binpath, persinfo = PERS pir,  
               share, split } = ir  
         val { group, lastseen, parsetree, skeleton } = pir  
         val ts = !lastseen  
         val nts = AbsPath.tstamp sourcepath  
     in  
         if TStamp.earlier (ts, nts) then  
             (lastseen := nts;  
              parsetree := NONE;  
              skeleton := NONE)  
         else ()  
     end  
   
190      (* the following functions are only concerned with getting the data,      (* the following functions are only concerned with getting the data,
191       * not with checking time stamps *)       * not with checking time stamps *)
192      fun getParseTree gp (i as INFO ir, quiet, noerrors) = let      fun getParseTree gp (i as INFO ir, quiet, noerrors) = let
# Line 252  Line 251 
251                              | NONE => NONE))                              | NONE => NONE))
252      end      end
253    
254      (* first check the time stamp, then do your stuff... *)      fun skeleton0 noerrors gp i = getSkeleton gp (i, noerrors)
     fun skeleton0 noerrors gp i = (validate i; getSkeleton gp (i, noerrors))  
255    
256      (* we only complain at the time of getting the exports *)      (* we only complain at the time of getting the exports *)
257      fun exports gp i = Option.map SkelExports.exports (skeleton0 false gp i)      fun exports gp i = Option.map SkelExports.exports (skeleton0 false gp i)
258      val skeleton = skeleton0 true      val skeleton = skeleton0 true
259    
260      fun parsetree gp i =      fun parsetree gp i = getParseTree gp (i, true, true)
         (validate i;  
          getParseTree gp (i, true, true))  
261    
262      fun spec (INFO { sourcepath, ... }) = AbsPath.spec sourcepath      fun spec (INFO { sourcepath, ... }) = AbsPath.spec sourcepath
263      fun fullSpec (INFO { sourcepath, persinfo = PERS { group, ... }, ... }) =      fun fullSpec (INFO { sourcepath, persinfo = PERS { group, ... }, ... }) =

Legend:
Removed from v.329  
changed lines
  Added in v.330

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