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 297, Thu May 27 08:29:19 1999 UTC revision 299, Thu May 27 13:53:27 1999 UTC
# Line 14  Line 14 
14      type complainer = GenericVC.ErrorMsg.complainer      type complainer = GenericVC.ErrorMsg.complainer
15      type ast = GenericVC.Ast.dec      type ast = GenericVC.Ast.dec
16      type region = GenericVC.SourceMap.region      type region = GenericVC.SourceMap.region
17        type source = GenericVC.Source.inputSource
18    
19      val resync : unit -> unit           (* rebuild internal table *)      val resync : unit -> unit           (* rebuild internal table *)
20    
21      val eq : info * info -> bool        (* compares sourcepaths *)      val eq : info * info -> bool        (* compares sourcepaths *)
22      val compare : info * info -> order  (* compares sourcepaths *)      val compare : info * info -> order  (* compares sourcepaths *)
23    
24      val info : GeneralParams.params ->      val info : GeneralParams.info ->
25          { sourcepath: AbsPath.t,          { sourcepath: AbsPath.t,
26            group: AbsPath.t * region,            group: AbsPath.t * region,
27            share: bool option }            share: bool option }
28          -> info          -> info
29    
30      val sourcepath : info -> AbsPath.t      val sourcepath : info -> AbsPath.t
31      val error : GeneralParams.params -> info -> complainer      val error : GeneralParams.info -> info -> complainer
32    
33      val parsetree : GeneralParams.params -> info -> ast option      val parsetree : GeneralParams.info -> info -> (ast * source) option
34      val exports : GeneralParams.params -> info  -> SymbolSet.set      val exports : GeneralParams.info -> info  -> SymbolSet.set
35      val skeleton : GeneralParams.params -> info -> Skeleton.decl      val skeleton : GeneralParams.info -> info -> Skeleton.decl
36      val share : info -> bool option      val share : info -> bool option
37    
38      (* different ways of describing an sml file using group and source *)      (* different ways of describing an sml file using group and source *)
# Line 58  Line 59 
59      datatype persinfo =      datatype persinfo =
60          PERS of { group: AbsPath.t * region,          PERS of { group: AbsPath.t * region,
61                    lastseen: TStamp.t ref,                    lastseen: TStamp.t ref,
62                    parsetree: { tree: ast, source: source } option ref,                    parsetree: (ast * source) option ref,
63                    skeleton: Skeleton.decl option ref }                    skeleton: Skeleton.decl option ref }
64    
65      datatype info =      datatype info =
# Line 69  Line 70 
70      fun sourcepath (INFO { sourcepath = sp, ... }) = sp      fun sourcepath (INFO { sourcepath = sp, ... }) = sp
71      fun share (INFO { share = s, ... }) = s      fun share (INFO { share = s, ... }) = s
72    
73      fun gerror (gp: GeneralParams.params) = GroupReg.error (#groupreg gp)      fun gerror (gp: GeneralParams.info) = GroupReg.error (#groupreg gp)
74    
75      fun error gp (INFO { persinfo = PERS { group, ... }, ... }) =      fun error gp (INFO { persinfo = PERS { group, ... }, ... }) =
76          gerror gp group          gerror gp group
# Line 92  Line 93 
93          knownInfo := foldl AbsPathMap.insert' AbsPathMap.empty l          knownInfo := foldl AbsPathMap.insert' AbsPathMap.empty l
94      end      end
95    
96      fun info (gp: GeneralParams.params) arg = let      fun info (gp: GeneralParams.info) arg = let
97          val { sourcepath, group = gr as (group, region), share } = arg          val { sourcepath, group = gr as (group, region), share } = arg
98          val groupreg = #groupreg gp          val groupreg = #groupreg gp
99          fun newpersinfo () = let          fun newpersinfo () = let
# Line 164  Line 165 
165                  val pto = let                  val pto = let
166                      val tree = SF.parse source                      val tree = SF.parse source
167                  in                  in
168                      SOME { tree = tree, source = source }                      SOME (tree, source)
169                  end handle SF.Compile msg => (TextIO.closeIn stream;                  end handle SF.Compile msg => (TextIO.closeIn stream;
170                                                err msg;                                                err msg;
171                                                NONE)                                                NONE)
# Line 184  Line 185 
185          case !skeleton of          case !skeleton of
186              SOME sk => sk              SOME sk => sk
187            | NONE => let            | NONE => let
188                  val skelpath = FNP.mkSkelPath (#fnpolicy gp) sourcepath                  val policy = #fnpolicy (#param gp)
189                    val skelpath = FNP.mkSkelPath policy sourcepath
190              in              in
191                  case SkelIO.read (skelpath, !lastseen) of                  case SkelIO.read (skelpath, !lastseen) of
192                      SOME sk => (skeleton := SOME sk; sk)                      SOME sk => (skeleton := SOME sk; sk)
193                    | NONE =>                    | NONE =>
194                          (case getParseTree gp (i, false, noerrors) of                          (case getParseTree gp (i, false, noerrors) of
195                               SOME { tree, source } => let                               SOME (tree, source) => let
196                                   fun err sv region s =                                   fun err sv region s =
197                                       EM.error source region sv s                                       EM.error source region sv s
198                                           EM.nullErrorBody                                           EM.nullErrorBody
# Line 218  Line 220 
220      fun exports gp i = SkelExports.exports (skeleton0 false gp i)      fun exports gp i = SkelExports.exports (skeleton0 false gp i)
221      val skeleton = skeleton0 true      val skeleton = skeleton0 true
222    
223      fun parsetree gp i =      fun parsetree gp i = getParseTree gp (i, true, true)
         Option.map #tree (getParseTree gp (i, true, true))  
224    
225      fun spec (INFO { sourcepath, ... }) = AbsPath.spec sourcepath      fun spec (INFO { sourcepath, ... }) = AbsPath.spec sourcepath
226      fun fullSpec (INFO { sourcepath, persinfo = PERS { group, ... }, ... }) =      fun fullSpec (INFO { sourcepath, persinfo = PERS { group, ... }, ... }) =

Legend:
Removed from v.297  
changed lines
  Added in v.299

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