Corrected a bug caused by making Structured parameterised, where removeNesting only descended into Structureds the same type as the outer-most Structured (typically A.AST)

This commit is contained in:
Neil Brown 2008-02-08 12:11:35 +00:00
parent e0d6c5eb08
commit 750612629b

View File

@ -181,12 +181,12 @@ removeNesting p
return s
where
pullSpecs :: Data t => t -> PassM t
pullSpecs = doGeneric `extM` doStructured
pullSpecs = doGeneric `ext1M` doStructured
doGeneric :: Data t => t -> PassM t
doGeneric = makeGeneric pullSpecs
doStructured :: A.Structured a -> PassM (A.Structured a)
doStructured :: Data t => A.Structured t -> PassM (A.Structured t)
doStructured s@(A.Spec m spec@(A.Specification _ n st) subS)
= do isConst <- isConstantName n
if isConst || canPull st then