diff --git a/common/Pass.hs b/common/Pass.hs index bc758dd..334ef84 100644 --- a/common/Pass.hs +++ b/common/Pass.hs @@ -39,7 +39,7 @@ instance Die PassM where dieReport = throwError -- | The type of an AST-mangling pass. -type Pass = A.Process -> PassM A.Process +type Pass = A.Structured -> PassM A.Structured -- | Compose a list of passes into a single pass. runPasses :: [(String, Pass)] -> Pass diff --git a/transformations/Unnest.hs b/transformations/Unnest.hs index f0ba51f..3984139 100644 --- a/transformations/Unnest.hs +++ b/transformations/Unnest.hs @@ -171,13 +171,13 @@ removeFreeNames = doGeneric `extM` doSpecification `extM` doProcess doProcess p = doGeneric p -- | Pull nested declarations to the top level. -removeNesting :: A.Process -> PassM A.Process +removeNesting :: A.Structured -> PassM A.Structured removeNesting p = do pushPullContext p' <- pullSpecs p - s <- applyPulled $ A.OnlyP emptyMeta p' + s <- applyPulled p' popPullContext - return $ A.Seq emptyMeta s + return s where pullSpecs :: Data t => t -> PassM t pullSpecs = doGeneric `extM` doStructured