Added support for the array constructors to typeOfExpression
This commit is contained in:
parent
ecad4e3abc
commit
1c155490c5
8
Types.hs
8
Types.hs
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue
Block a user