Changed the shared passes to operate on Structured items, rather than Process items
This commit is contained in:
parent
1c858e112c
commit
3727307a78
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user