Fixed a couple of problems with the usage checking
This commit is contained in:
parent
68f808583b
commit
bcd670bfd2
|
@ -314,8 +314,13 @@ checkPlainVarUsage sharedAttr (m, p) = check p
|
||||||
splitEnds :: (Var, a) -> m [(Var, a)]
|
splitEnds :: (Var, a) -> m [(Var, a)]
|
||||||
splitEnds (Var v, x)
|
splitEnds (Var v, x)
|
||||||
= do t <- astTypeOf v
|
= do t <- astTypeOf v
|
||||||
case t of
|
case (t, v) of
|
||||||
A.Chan {} -> return
|
-- Push the direction up to the array, not outside:
|
||||||
|
(A.Chan {}, A.SubscriptedVariable m sub v')
|
||||||
|
-> return [(Var $ A.SubscriptedVariable m sub $
|
||||||
|
A.DirectedVariable m dir v', x)
|
||||||
|
| dir <- [A.DirInput, A.DirOutput]]
|
||||||
|
(A.Chan {}, _) -> return
|
||||||
[(Var $ A.DirectedVariable (findMeta v) dir v, x)
|
[(Var $ A.DirectedVariable (findMeta v) dir v, x)
|
||||||
| dir <- [A.DirInput, A.DirOutput]]
|
| dir <- [A.DirInput, A.DirOutput]]
|
||||||
_ -> return [(Var v, x)]
|
_ -> return [(Var v, x)]
|
||||||
|
|
|
@ -204,7 +204,7 @@ abbrevCheckPass
|
||||||
return s
|
return s
|
||||||
doStructured s@(A.Spec _ (A.Specification m n (A.IsExpr _ A.ValAbbrev _ e)) scope)
|
doStructured s@(A.Spec _ (A.Specification m n (A.IsExpr _ A.ValAbbrev _ e)) scope)
|
||||||
= do checkNotWritten (A.Variable m n) scope "VAL-abbreviated variable % written-to inside the scope of the abbreviation"
|
= do checkNotWritten (A.Variable m n) scope "VAL-abbreviated variable % written-to inside the scope of the abbreviation"
|
||||||
sequence_ [checkAbbreved v scope
|
sequence_ [checkNotWritten v scope
|
||||||
"Abbreviated variable % used inside the scope of the abbreviation"
|
"Abbreviated variable % used inside the scope of the abbreviation"
|
||||||
| A.ExprVariable _ v <- listify (const True) e]
|
| A.ExprVariable _ v <- listify (const True) e]
|
||||||
return s
|
return s
|
||||||
|
|
Loading…
Reference in New Issue
Block a user