Commit 061ce2c8 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-08-22 15:04:55 by simonmar]

Slight change to the semantics so that global vars can be modified
from within a macro.
parent 284db99f
......@@ -3,7 +3,6 @@ module CmdSemantics ( parseOneTFile, processParsedTFile )
where
import CmdSyntax
import CmdLexer ( isVarChar )
import CmdParser ( parseScript )
import TopSort ( topSort )
import Maybe ( isJust, fromJust )
......@@ -168,11 +167,11 @@ setResult is_actual res
addLocalVarBind :: Var -> String -> IOEV ()
addLocalVarBind v s
= getEvalEnv `thenE` \ p ->
if v `elem` map fst (globals p)
then failEV (isGlobalVar v)
else setEvalEnv (p{locals = (v,s):(locals p)})
`thenE_`
returnEV ()
(if v `elem` map fst (globals p)
then setEvalEnv (p{globals = (v,s):(globals p)})
else setEvalEnv (p{locals = (v,s):(locals p)})
) `thenE_`
returnEV ()
getCounterE :: IOE Int
getCounterE
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment