[Git][ghc/ghc][wip/az/epa-fix-transform-anchoreof] EPA: Rename Transform.anchorEof to addModuleCommentOrigDeltas
Alan Zimmerman pushed to branch wip/az/epa-fix-transform-anchoreof at Glasgow Haskell Compiler / GHC Commits: 4588a803 by Alan Zimmerman at 2026-06-07T22:06:43+01:00 EPA: Rename Transform.anchorEof to addModuleCommentOrigDeltas This now matches what it actually does. - - - - - 2 changed files: - utils/check-exact/Main.hs - utils/check-exact/Transform.hs Changes: ===================================== utils/check-exact/Main.hs ===================================== @@ -646,7 +646,7 @@ addLocaLDecl3 :: Changer addLocaLDecl3 libdir top = do Right newDecl <- withDynFlags libdir (\df -> parseDecl df "decl" "nn = 2") let - doAddLocal = replaceDecls (anchorEof lp) [parent',d2'] + doAddLocal = replaceDecls (addModuleCommentOrigDeltas lp) [parent',d2'] where lp = top (de1:d2:_) = hsDecls lp @@ -667,7 +667,7 @@ addLocaLDecl4 libdir lp = do Right newDecl <- withDynFlags libdir (\df -> parseDecl df "decl" "nn = 2") Right newSig <- withDynFlags libdir (\df -> parseDecl df "sig" "nn :: Int") let - doAddLocal = replaceDecls (anchorEof lp) (parent':ds) + doAddLocal = replaceDecls (addModuleCommentOrigDeltas lp) (parent':ds) where (parent:ds) = hsDecls (makeDeltaAst lp) @@ -781,7 +781,7 @@ rmDecl3 _libdir lp = do rmDecl4 :: Changer rmDecl4 _libdir lp = do let - doRmDecl = replaceDecls (anchorEof lp) [de1',sd1] + doRmDecl = replaceDecls (addModuleCommentOrigDeltas lp) [de1',sd1] where [de1] = hsDecls lp (de1',Just sd1) = modifyValD (getLocA de1) de1 $ \_m [sd1a,sd2] -> ===================================== utils/check-exact/Transform.hs ===================================== @@ -65,7 +65,7 @@ module Transform , balanceComments , balanceCommentsList , balanceCommentsListA - , anchorEof + , addModuleCommentOrigDeltas -- ** Managing lists, pure functions , captureOrderBinds @@ -724,8 +724,8 @@ balanceSameLineComments (L la (Match anm mctxt pats (GRHSs x grhss lb))) -- --------------------------------------------------------------------- -anchorEof :: ParsedSource -> ParsedSource -anchorEof (L l m@(HsModule (XModulePs an _lo _ _) _mn _exps _imps _decls)) = L l (m { hsmodExt = (hsmodExt m){ hsmodAnn = an' } }) +addModuleCommentOrigDeltas :: ParsedSource -> ParsedSource +addModuleCommentOrigDeltas (L l m@(HsModule (XModulePs an _lo _ _) _mn _exps _imps _decls)) = L l (m { hsmodExt = (hsmodExt m){ hsmodAnn = an' } }) where an' = addCommentOrigDeltasAnn an View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4588a8030dce3834501e31aad55932d7... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4588a8030dce3834501e31aad55932d7... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Alan Zimmerman (@alanz)