Added support for the time statements in the usage checker

This commit is contained in:
Neil Brown 2007-10-29 17:57:57 +00:00
parent a891e34d24
commit cb964c620f
2 changed files with 8 additions and 0 deletions

View File

@ -81,6 +81,8 @@ getVarProc (A.Assign _ vars expList)
(foldUnionVars (map processVarW vars))
--All variables read on the RHS:
(getVarExpList expList)
getVarProc (A.GetTime _ v) = processVarW v
getVarProc (A.Wait _ _ e) = getVarExp e
--TODO output input etc (all other processes that directly write to/read from variables)
getVarProc _ = emptyVars

View File

@ -76,6 +76,12 @@ testGetVarProc = TestList (map doTest tests)
--Test assignments and expressions:
,(200,[tvB],[tvA],[tvA],[],a_eq_not_b)
,(201,[tvC,tvD],[tvA],[tvA],[],a_eq_c_plus_d)
-- Test time statements:
,(300,[],[tvB],[tvB],[],A.GetTime emptyMeta vB)
,(301,[tvA],[],[],[],A.Wait emptyMeta A.WaitFor $ A.ExprVariable emptyMeta vA)
]
doTest :: (Int,[Var],[Var],[Var],[Var],A.Process) -> Test