Added a quick work-around in SimplifyAbbrevs for the SYB-Map issue

This commit is contained in:
Neil Brown 2009-03-22 00:32:56 +00:00
parent 2fc327287a
commit 81ebebe4fe

View File

@ -183,13 +183,20 @@ updateAbbrevsInState
= pass "Update INITIAL and RESULT abbreviations in state" = pass "Update INITIAL and RESULT abbreviations in state"
[Prop.initialRemoved, Prop.resultRemoved] [Prop.initialRemoved, Prop.resultRemoved]
[] []
(\v -> get >>= applyDepthM (return . doAbbrevMode) >>= put >> return v) (\v -> get >>* doNameAbbrevs >>= applyDepthM (return . doAbbrevMode)
>>= put >> return v)
where where
doAbbrevMode :: A.AbbrevMode -> A.AbbrevMode doAbbrevMode :: A.AbbrevMode -> A.AbbrevMode
doAbbrevMode A.InitialAbbrev = A.Original doAbbrevMode A.InitialAbbrev = A.Original
doAbbrevMode A.ResultAbbrev = A.Abbrev doAbbrevMode A.ResultAbbrev = A.Abbrev
doAbbrevMode s = s doAbbrevMode s = s
-- Until Polyplate is merged, this fixes updating the abbreviation modes in
-- the csNames map
doNameAbbrevs :: CompState -> CompState
doNameAbbrevs cs = cs { csNames = flip Map.map (csNames cs) $
\nd -> nd { A.ndAbbrevMode = doAbbrevMode (A.ndAbbrevMode nd) } }
abbrevCheckPass :: Pass abbrevCheckPass :: Pass
abbrevCheckPass abbrevCheckPass
= pass "Abbreviation checking" [] [] = pass "Abbreviation checking" [] []