Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/compiler/ElabData/main/compinfo.sml
ViewVC logotype

View of /sml/trunk/compiler/ElabData/main/compinfo.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2603 - (download) (annotate)
Wed May 23 21:50:42 2007 UTC (13 years ago) by dbm
File size: 1125 byte(s)
merge of primop3/base branch -r2492:2602 into trunk
(* compinfo.sml
 *
 * (C) 2001 Lucent Technologies, Bell Labs
 *)
structure CompInfo = struct

  type 'absyn compInfo = { mkStamp: unit -> Stamps.stamp,
                    mkLvar: Symbol.symbol option -> Access.lvar,
                    anyErrors: bool ref,
                    error: ErrorMsg.errorFn,
                    errorMatch: SourceMap.region -> string,
                    transform: 'absyn -> 'absyn,
                    sourceName : string }

  fun mkCompInfo { source, transform : 'a -> 'a, mkMkStamp } =
      let val { error, errorMatch, anyErrors } = ErrorMsg.errors source
          val _ = LambdaVar.clear ()
          val g = mkMkStamp ()
          fun mkLvar NONE = LambdaVar.mkLvar ()
            | mkLvar (SOME sym) = LambdaVar.namedLvar sym
      in { mkStamp = fn () => Stamps.fresh g,
           mkLvar = mkLvar,
           anyErrors = anyErrors,
           error = error,
           errorMatch = errorMatch,
           transform = transform,
           sourceName = #fileOpened source } : 'a compInfo
      end

  fun anyErrors (ci : 'a compInfo) = ! (#anyErrors ci)

end (* structure CompBasic *)

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