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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/typechecker/typechecker.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/typechecker/typechecker.sml

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

revision 649, Fri Mar 18 15:47:56 2011 UTC revision 650, Fri Mar 18 20:51:42 2011 UTC
# Line 18  Line 18 
18      structure TU = TypeUtil      structure TU = TypeUtil
19      structure U = Util      structure U = Util
20    
21      (* standard method names *)
22        val stabilizeAtom = Atom.atom "stabilize"
23        val updateAtom = Atom.atom "update"
24    
25      datatype scope = GlobalScope | StrandScope | MethodScope | InitScope      datatype scope = GlobalScope | StrandScope | MethodScope | InitScope
26    
27      type env = {scope : scope, env : Env.env}      type env = {scope : scope, env : Env.env}
# Line 475  Line 479 
479                  end                  end
480          (* check the strand methods *)          (* check the strand methods *)
481            val methods = List.map (fn m => checkMethod (env, cxt, m)) methods            val methods = List.map (fn m => checkMethod (env, cxt, m)) methods
482            (* get the set of methods defined by the user *)
483              val methodNames = List.foldl
484                    (fn (AST.M_Method(name, _), names) => AtomSet.add(names, name))
485                      AtomSet.empty
486                        methods
487            (* if the stabilize method is not provided, add one *)
488              val methods = if AtomSet.member(methodNames, stabilizeAtom)
489                    then methods
490                    else methods @ [AST.M_Method(stabilizeAtom, AST.S_Block[])]
491            in            in
492                if not(AtomSet.member(methodNames, updateAtom))
493                  then err(cxt, [S "strand ", A name, S " is missing an update method"])
494                  else ();
495              AST.D_Strand{name = name, params = params, state = vds, methods = methods}              AST.D_Strand{name = name, params = params, state = vds, methods = methods}
496            end            end
497    

Legend:
Removed from v.649  
changed lines
  Added in v.650

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