From 8fae7c40151533329d3b913a111429055ba1e13e Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Mon, 30 Apr 2007 17:02:50 +0000 Subject: [PATCH] Handle IsExpr SubscriptedExpr properly when pulling up --- fco2/SimplifyExprs.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fco2/SimplifyExprs.hs b/fco2/SimplifyExprs.hs index d7e9534..634e176 100644 --- a/fco2/SimplifyExprs.hs +++ b/fco2/SimplifyExprs.hs @@ -108,11 +108,13 @@ pullUp = doGeneric `extM` doStructured `extM` doProcess `extM` doSpecification ` -- | *Don't* pull anything that's already an abbreviation -- but do convert -- RetypesExpr into Retypes (of a variable). doSpecification :: A.Specification -> PassM A.Specification + -- Iss might be SubscriptedVars -- which is fine; the backend can deal with that. doSpecification (A.Specification m n (A.Is m' am t v)) = do v' <- doGeneric v -- note doGeneric rather than pullUp return $ A.Specification m n (A.Is m' am t v') + -- IsExprs might be SubscriptedExprs, and if so we have to convert them. doSpecification (A.Specification m n (A.IsExpr m' am t e)) - = do e' <- doGeneric e -- note doGeneric rather than pullUp + = do e' <- doExpression' e -- note doExpression' rather than pullUp return $ A.Specification m n (A.IsExpr m' am t e') doSpecification (A.Specification m n (A.RetypesExpr m' am toT e)) = do e' <- doExpression e