Added support for the array constructors to typeOfExpression

This commit is contained in:
Neil Brown 2007-08-29 14:07:52 +00:00
parent ecad4e3abc
commit 1c155490c5

View File

@ -201,6 +201,14 @@ typeOfExpression e
A.BytesInExpr m e -> return A.Int
A.BytesInType m t -> return A.Int
A.OffsetOf m t n -> return A.Int
A.ExprConstr m (A.RangeConstr _ b e) ->
do bt <- typeOfExpression b
et <- typeOfExpression e
if bt == et then return (A.Array [A.UnknownDimension] bt) else dieP m "Types did not match for beginning and end of range"
A.ExprConstr m (A.RepConstr _ rep e) ->
do t <- typeOfExpression e
count <- evalIntExpression $ sizeOfReplicator rep
return $ A.Array [A.Dimension count] t
--}}}
returnTypesOfFunction :: (CSM m, Die m) => A.Name -> m [A.Type]