Alan Zimmerman pushed to branch wip/az/exactprint-annotation-rationalisation at Glasgow Haskell Compiler / GHC Commits: 0ff41c0e by Alan Zimmerman at 2026-09-24T11:02:40+01:00 MOVE: Exactprint layout scope plan. Do not commit - - - - - 97be233b by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: tidy up a bit. Combine somewhere else - - - - - ab12bb37 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Introduce LayoutFrame stacks in ExactPrint state - - - - - 751058a9 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 Align with ghc-exactprint - - - - - e917fb51 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Fix AnnList leading semis when layout When there is layout, anything printed triggers it, including leading semis. Add some test case examples too - - - - - 70714290 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 Exactprint: tidy up layout capturing - - - - - 290d1948 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: add makeDelta test for Test20297 The original #20297 related to comment placement for exact printing after running ExactPrint.makeDelta on ParsedSource. Add an additional test that explicitly tests this. - - - - - 69a5f176 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Make ValBinds LocatedA in HsLocalBindsLR If we have items with an AnnList Annotation, as part of another, which has different content, it must be LocatedA. This is a technical requirement due to the way comment allocation happens during the makeDelta processing. Comments are queued for printing, and as soon as any non-comment is to be printed, the pending comments before that position are printed, and in makeDelta processing these attached as preceding comments to the thing just printed. The means they end up captured inside the layout region of the AnnList item. So for foo = x where -- comment x = 3 the comment ends up as a preceding comment of `x = 3`, inside the layout, and prints as foo = x where -- comment x = 3 - - - - - dc1510c9 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Make IPBinds LocatedA - - - - - 0e1d283d by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Make ClsInstDecl decls LocatedA - - - - - 4d0574c8 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Make ClassDecls decls LocatedA - - - - - acb08ef2 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Make ClosedTypeFamily equations Located For FamilyDecl/ClosedTypeFamily - - - - - b77f1c3e by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Make dd_cons located - - - - - 1a6c9c54 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Make HsMultiIf options located - - - - - 4b960994 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Make DecBrl contents LocatedA - - - - - 90532ca0 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Located do statements - - - - - 40f055d7 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Print RecStmt located - - - - - 7d93f2ee by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: HsCmdDo Located - - - - - 8341dcd4 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 Extend Test20297 for additional occurrences - - - - - fce8043f by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Tweak PatSynBind location for comments - - - - - 7d05fed9 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: WIP, add test for where ;; ValBinds - - - - - 2495cef1 by Alan Zimmerman at 2026-09-24T11:02:49+01:00 EPA: Make EpVirtualBraces noSpanAnchor if no contents Otherwise the vocurly is emitted at the start of the next item parsed Check: is this needed, or just a check for empty contents? - - - - - 9cb8b9b9 by Alan Zimmerman at 2026-09-24T17:51:46+01:00 EPA: Use EpNoLayout in AnnList with empty contents and no explicit braces - - - - - 602cd545 by Alan Zimmerman at 2026-09-24T18:49:55+01:00 TODO: XClassDecl: remove additional EpLayout - - - - - 6170ccb1 by Alan Zimmerman at 2026-09-24T18:49:55+01:00 WIP: turn off exactprint debug printing - - - - - caa62748 by Alan Zimmerman at 2026-09-24T18:49:55+01:00 EPA: Remove CanUpdateAnchorOnly - - - - - 534c3e18 by Alan Zimmerman at 2026-09-24T18:49:55+01:00 Plan update DO NOT COMMIT - - - - - fb713865 by Alan Zimmerman at 2026-09-24T20:33:12+01:00 EPA: First pass implementation of HsList, for ClassDecls Just as a straight list replacement to start with, no payload. This shows the scope and invasiveness of the initial change - - - - - 0036bee3 by Alan Zimmerman at 2026-09-24T20:33:12+01:00 EPA: HsList attempt WIP - - - - - 823d41ac by Alan Zimmerman at 2026-09-24T20:33:12+01:00 Enable ppr test for Haddock1. It currently fails - - - - - 73458c58 by Alan Zimmerman at 2026-09-24T20:33:12+01:00 WIP on removing NoEpAnn. Likely abandon - - - - - f6c262d0 by Alan Zimmerman at 2026-09-24T20:33:12+01:00 EPA: Add an overview doc for exact printing - - - - - 88562119 by Simon Peyton Jones at 2026-09-24T20:33:12+01:00 Added an intro section - - - - - 80 changed files: - ANNLIST-LAYOUT-PLAN.md - + ExactPrint.md - + LAYOUT-SCOPE-PLAN.md - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Main/Interactive.hs - compiler/GHC/Hs.hs - compiler/GHC/Hs/Binds.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/DocString.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/ImpExp.hs - compiler/GHC/Hs/Instances.hs - compiler/GHC/Hs/Stats.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Docs.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Names.hs - compiler/GHC/Rename/Splice.hs - compiler/GHC/Runtime/Eval.hs - compiler/GHC/Tc/Deriv.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Utils/Env.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/ThToHs.hs - compiler/Language/Haskell/Syntax.hs - compiler/Language/Haskell/Syntax/Basic.hs - compiler/Language/Haskell/Syntax/Binds.hs - compiler/Language/Haskell/Syntax/Decls.hs - compiler/Language/Haskell/Syntax/Expr.hs - ghc/GHCi/UI.hs - testsuite/tests/ghc-api/exactprint/Test20239.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.hs - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T14189.stderr - testsuite/tests/parser/should_compile/T15323.stderr - testsuite/tests/parser/should_compile/T20452.stderr - testsuite/tests/perf/compiler/hard_hole_fits.stderr - testsuite/tests/printer/Makefile - testsuite/tests/printer/Ppr003.hs - testsuite/tests/printer/T18791.stderr - + testsuite/tests/printer/Test20297.expected.hs - testsuite/tests/printer/Test20297.hs - testsuite/tests/printer/Test20297.stdout - + testsuite/tests/printer/Test20297MD.stdout - testsuite/tests/printer/Test24533.stdout - testsuite/tests/printer/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Main.hs - utils/check-exact/Parsers.hs - utils/check-exact/Transform.hs - utils/check-exact/Utils.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs - utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs - utils/haddock/haddock-api/src/Haddock/Convert.hs - utils/haddock/haddock-api/src/Haddock/GhcUtils.hs - utils/haddock/haddock-api/src/Haddock/Interface/Create.hs - utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs - utils/haddock/haddock-api/src/Haddock/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8ebd722dffe09368c05d69ad201f9f2... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8ebd722dffe09368c05d69ad201f9f2... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help