summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2022-12-31 13:53:16 +0000
committerAlan Zimmerman <alan.zimm@gmail.com>2023-01-09 18:02:01 +0000
commitb3808a7c8b7c58fb428ffb12b8511ce6f59de72d (patch)
tree85677da1f576bd8f1d7dc5cf15d6d8040bbb033b
parent8d00ca3b39a60887b2278aeeeb0e756efe113c97 (diff)
downloadhaskell-b3808a7c8b7c58fb428ffb12b8511ce6f59de72d.tar.gz
WIP
Down to 23 failures
-rw-r--r--utils/check-exact/ExactPrint.hs7
-rw-r--r--utils/check-exact/Transform.hs8
2 files changed, 9 insertions, 6 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs
index a3b0ab2a40..0124bf46b6 100644
--- a/utils/check-exact/ExactPrint.hs
+++ b/utils/check-exact/ExactPrint.hs
@@ -1448,13 +1448,14 @@ instance ExactPrint (HsModule GhcPs) where
return (an1, Just m', mdeprec', mexports')
- -- Get rid of the balance of the header comments
- -- cs <- getUnallocatedComments
- -- flushComments []
let ann_decls = EpAnn (entry an) (am_decls $ anns an0) emptyComments
(ann_decls', (decls', imports')) <- markAnnList' False ann_decls $ do
imports' <- markTopLevelList imports
+
+ -- Get rid of the balance of the header comments
+ flushComments []
+
decls' <- markTopLevelList decls
-- Need to add trailing comments that may come before the final `}`
addCommentsA $ getFollowingComments (comments an)
diff --git a/utils/check-exact/Transform.hs b/utils/check-exact/Transform.hs
index ca23eab794..a446eac45b 100644
--- a/utils/check-exact/Transform.hs
+++ b/utils/check-exact/Transform.hs
@@ -666,8 +666,10 @@ balanceComments' la1 la2 = do
simpleBreak n (r,_) = r > n
L (SrcSpanAnn an1 loc1) f = la1
L (SrcSpanAnn an2 loc2) s = la2
- anc1 = addCommentOrigDeltas $ epAnnComments an1
- anc2 = addCommentOrigDeltas $ epAnnComments an2
+ -- anc1 = addCommentOrigDeltas $ epAnnComments an1
+ -- anc2 = addCommentOrigDeltas $ epAnnComments an2
+ anc1 = epAnnComments an1
+ anc2 = epAnnComments an2
cs1s = splitCommentsEnd (anchorFromLocatedA la1) anc1
`debug` ("balanceComments': (anc1, anc2):" ++ showAst (anc1, anc2))
@@ -941,7 +943,7 @@ insertAt f t decl = do
-- let oldDecls'' = captureLineSpacing oldDeclsb
-- `debug` ("oldDecls':" ++ showAst oldDecls')
r <- replaceDecls t (f decl oldDecls)
- -- `debug` ("oldDecls'':" ++ showAst oldDecls'')
+ `debug` ("oldDeclsb:" ++ showAst oldDeclsb)
return r
-- |Insert a declaration at the beginning or end of the subdecls of the given