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
|
dieReport = throwError
|
||||||
|
|
||||||
-- | The type of an AST-mangling pass.
|
-- | 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.
|
-- | Compose a list of passes into a single pass.
|
||||||
runPasses :: [(String, Pass)] -> Pass
|
runPasses :: [(String, Pass)] -> Pass
|
||||||
|
|
|
@ -171,13 +171,13 @@ removeFreeNames = doGeneric `extM` doSpecification `extM` doProcess
|
||||||
doProcess p = doGeneric p
|
doProcess p = doGeneric p
|
||||||
|
|
||||||
-- | Pull nested declarations to the top level.
|
-- | Pull nested declarations to the top level.
|
||||||
removeNesting :: A.Process -> PassM A.Process
|
removeNesting :: A.Structured -> PassM A.Structured
|
||||||
removeNesting p
|
removeNesting p
|
||||||
= do pushPullContext
|
= do pushPullContext
|
||||||
p' <- pullSpecs p
|
p' <- pullSpecs p
|
||||||
s <- applyPulled $ A.OnlyP emptyMeta p'
|
s <- applyPulled p'
|
||||||
popPullContext
|
popPullContext
|
||||||
return $ A.Seq emptyMeta s
|
return s
|
||||||
where
|
where
|
||||||
pullSpecs :: Data t => t -> PassM t
|
pullSpecs :: Data t => t -> PassM t
|
||||||
pullSpecs = doGeneric `extM` doStructured
|
pullSpecs = doGeneric `extM` doStructured
|
||||||
|
|
Loading…
Reference in New Issue
Block a user