From cb819d142ae87fd8881534bcd03392dc567b41de Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 19 Mar 2008 13:23:20 +0000 Subject: [PATCH] Altered transformConstr to handle array constructors with types in them --- transformations/SimplifyExprs.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/transformations/SimplifyExprs.hs b/transformations/SimplifyExprs.hs index eb34b30..72ab724 100644 --- a/transformations/SimplifyExprs.hs +++ b/transformations/SimplifyExprs.hs @@ -205,14 +205,11 @@ transformConstr = doGeneric `ext1M` doStructured -- indexvar := indexvar + 1 -- ... doStructured :: Data a => A.Structured a -> PassM (A.Structured a) - doStructured (A.Spec m (A.Specification m' n (A.IsExpr _ _ _ expr@(A.ExprConstr m'' (A.RepConstr _ rep exp)))) scope) + doStructured (A.Spec m (A.Specification m' n (A.IsExpr _ _ _ expr@(A.ExprConstr m'' (A.RepConstr _ t rep exp)))) scope) = do indexVarSpec@(A.Specification _ indexName _) <- makeNonceVariable "array_constr_index" m'' A.Int A.VariableName A.Original let indexVar = A.Variable m'' indexName scope' <- doGeneric scope - -- Recompute the type, in order to get the array dimension into it. - t <- typeOfExpression expr - return $ A.Spec m (A.Specification m' n (A.Declaration m' t)) $ A.ProcThen m'' (A.Seq m'' $ A.Spec m'' indexVarSpec $ A.Several m'' [ A.Only m'' $ A.Assign m'' [indexVar] $ A.ExpressionList m'' [A.Literal m'' A.Int $ A.IntLiteral m'' "0"],