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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/typechecker/check-var-uses.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/typechecker/check-var-uses.sml

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

revision 3417, Thu Nov 12 23:41:06 2015 UTC revision 3418, Fri Nov 13 00:00:26 2015 UTC
# Line 26  Line 26 
26    
27      fun unusedWarning ((errStrm, _), x) =      fun unusedWarning ((errStrm, _), x) =
28            Error.warning (errStrm, TypeError.format [            Error.warning (errStrm, TypeError.format [
29                S(Var.kindToString x), S " '", V x, S "' declared at line ",                S(Var.kindToString x), S " ", V x, S " declared at line ",
30                LN(Var.locationOf x), S " is unused"                LN(Var.locationOf x), S " is unused"
31              ])              ])
32    
# Line 40  Line 40 
40              | _ => (              | _ => (
41                  if VSet.member(undef, x) andalso VSet.member(undef, x)                  if VSet.member(undef, x) andalso VSet.member(undef, x)
42                    then TypeError.error ((#1 cxt, span), [                    then TypeError.error ((#1 cxt, span), [
43                        S "possible use of variable '", V x, S "' before it has been initialized"                        S "possible use of variable ", V x, S " before it has been initialized"
44                      ])                      ])
45                    else ();                    else ();
46                  VSet.subtract(unused, x))                  VSet.subtract(unused, x))
# Line 181  Line 181 
181          (* check for undefined output variables *)          (* check for undefined output variables *)
182              List.app              List.app
183                (fn x => if VSet.member(undef, x)                (fn x => if VSet.member(undef, x)
184                    then error (cxt, [S "strand output variable '", V x, S "' is not initialized"])                    then error (cxt, [S "strand output variable ", V x, S " is not initialized"])
185                    else ()                    else ()
186                  ) outputs;                  ) outputs;
187            (* report unused state variables *)            (* report unused state variables *)

Legend:
Removed from v.3417  
changed lines
  Added in v.3418

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