Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/typechecker/typechecker.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/typechecker/typechecker.sml

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

revision 2650, Thu May 29 20:55:52 2014 UTC revision 2651, Thu May 29 21:31:37 2014 UTC
# Line 21  Line 21 
21      structure TU = TypeUtil      structure TU = TypeUtil
22      structure U = Util      structure U = Util
23    
24      (* variable properties to support warnings etc. *)
25        val {getFn=isUsed, setFn=markUsed} = Var.newFlag()          (* for unused variable warning *)
26        val {getFn=isShadowed, setFn=marShadowed} = Var.newFlag()   (* for shadowed decl warning *)
27    
28    (* exception to abort typechecking when we hit an error.  Eventually, we should continue    (* exception to abort typechecking when we hit an error.  Eventually, we should continue
29     * checking for more errors and not use this.     * checking for more errors and not use this.
30     *)     *)
# Line 246  Line 250 
250      fun checkExpr (env : env, cxt, e) = (case e      fun checkExpr (env : env, cxt, e) = (case e
251             of PT.E_Mark m => checkExpr (withEnvAndContext (env, cxt, m))             of PT.E_Mark m => checkExpr (withEnvAndContext (env, cxt, m))
252              | PT.E_Var x => (case Env.findVar (#env env, x)              | PT.E_Var x => (case Env.findVar (#env env, x)
253                   of SOME x' => (AST.E_Var x', Var.monoTypeOf x')                   of SOME x' => (
254                          markUsed (x', true);
255                          (AST.E_Var x', Var.monoTypeOf x'))
256                    | NONE => err(cxt, [S "undeclared variable ", A x])                    | NONE => err(cxt, [S "undeclared variable ", A x])
257                  (* end case *))                  (* end case *))
258              | PT.E_Lit lit => checkLit lit              | PT.E_Lit lit => checkLit lit

Legend:
Removed from v.2650  
changed lines
  Added in v.2651

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