Changed the shared passes to operate on Structured items, rather than Process items

This commit is contained in:
Neil Brown 2007-10-17 13:24:42 +00:00
parent 1c858e112c
commit 3727307a78
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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