Rain: implemented the pass to give declarations unique names
This commit is contained in:
parent
9d9b6dd73f
commit
34eac44d45
|
@ -23,8 +23,11 @@ rainPasses = runPasses passes
|
||||||
uniquifyVars :: Data t => t -> PassM t
|
uniquifyVars :: Data t => t -> PassM t
|
||||||
uniquifyVars = everywhereM (mkM uniquifyVars')
|
uniquifyVars = everywhereM (mkM uniquifyVars')
|
||||||
where
|
where
|
||||||
uniquifyVars' :: A.Structured -> PassM A.Structured
|
uniquifyVars' :: A.Specification -> PassM A.Specification
|
||||||
uniquifyVars' = return
|
uniquifyVars' (A.Specification m n decl@(A.Declaration _ _))
|
||||||
|
= do n' <- makeNonce $ A.nameName n
|
||||||
|
return (A.Specification m n {A.nameName = n'} decl)
|
||||||
|
uniquifyVars' s = return s
|
||||||
|
|
||||||
transformEach :: Data t => t -> PassM t
|
transformEach :: Data t => t -> PassM t
|
||||||
transformEach = everywhereM (mkM transformEach')
|
transformEach = everywhereM (mkM transformEach')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user