334 |
(* check that x' is mutable *) |
(* check that x' is mutable *) |
335 |
case Var.kindOf x' |
case Var.kindOf x' |
336 |
of Var.ActorStateVar => () |
of Var.ActorStateVar => () |
337 |
|
| Var.ActorOutputVar => () |
338 |
| Var.LocalVar => () |
| Var.LocalVar => () |
339 |
| _ => err(cxt, [ |
| _ => err(cxt, [ |
340 |
S "assignment to immutable variable ", A x |
S "assignment to immutable variable ", A x |
388 |
(* check the actor state variable definitions *) |
(* check the actor state variable definitions *) |
389 |
val (vds, env) = let |
val (vds, env) = let |
390 |
fun checkStateVar ((isOut, vd), (vds, env)) = let |
fun checkStateVar ((isOut, vd), (vds, env)) = let |
391 |
val (x, x', e') = checkVarDecl ({globalScope=false, env=env}, cxt, AST.ActorStateVar, vd) |
val kind = if isOut then AST.ActorOutputVar else AST.ActorStateVar |
392 |
|
val (x, x', e') = checkVarDecl ({globalScope=false, env=env}, cxt, kind, vd) |
393 |
in |
in |
394 |
((isOut, AST.VD_Decl(x', e'))::vds, Env.insertLocal(env, x, x')) |
(AST.VD_Decl(x', e')::vds, Env.insertLocal(env, x, x')) |
395 |
end |
end |
396 |
val (vds, env) = List.foldl checkStateVar ([], env) state |
val (vds, env) = List.foldl checkStateVar ([], env) state |
397 |
in |
in |