From 46de1956b3ba03bf68ae51432e7920e1c886b4c7 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 27 Feb 2008 19:58:09 +0000 Subject: [PATCH] Corrected the pulling up of SEQ replicator counts to descend properly into nested functions --- transformations/SimplifyExprs.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/transformations/SimplifyExprs.hs b/transformations/SimplifyExprs.hs index 482f1e7..bc3d4d8 100644 --- a/transformations/SimplifyExprs.hs +++ b/transformations/SimplifyExprs.hs @@ -155,8 +155,11 @@ pullRepCounts = doGeneric `extM` doProcess doProcess p = doGeneric p pullRepCountSeq :: A.Structured A.Process -> PassM (A.Structured A.Process) - pullRepCountSeq (A.Only m p) = pullRepCounts p >>* A.Only m - pullRepCountSeq (A.Spec m sp str) = pullRepCountSeq str >>* A.Spec m sp + pullRepCountSeq (A.Only m p) = doProcess p >>* A.Only m + pullRepCountSeq (A.Spec m sp str) + = do sp' <- pullRepCounts sp + str' <- pullRepCountSeq str + return $ A.Spec m sp' str' pullRepCountSeq (A.ProcThen m p s) = do p' <- doProcess p s' <- pullRepCountSeq s