[Git][ghc/ghc][wip/az/epa-epalocation-not-anchor] EPA: Replace Anchor with EpaLocation

Alan Zimmerman (@alanz) gitlab at gitlab.haskell.org
Sat Nov 11 15:26:43 UTC 2023



Alan Zimmerman pushed to branch wip/az/epa-epalocation-not-anchor at Glasgow Haskell Compiler / GHC


Commits:
db811ddf by Alan Zimmerman at 2023-11-11T15:26:08+00:00
EPA: Replace Anchor with EpaLocation

An Anchor has a location and an operation, which is either that it is
unchanged or that it has moved with a DeltaPos

    data Anchor = Anchor { anchor :: RealSrcSpan
                         , anchor_op :: AnchorOperation }

An EpaLocation also has either a location or a DeltaPos

    data EpaLocation = EpaSpan !RealSrcSpan !(Strict.Maybe BufSpan)
                     | EpaDelta !DeltaPos ![LEpaComment]

Now that we do not care about always having a location in the anchor,
we remove Anchor and replace it with EpaLocation

We do this with a type alias initially, to ease the transition.
The alias will be removed in time.

We also have helpers to reconstruct the AnchorOperation from an
EpaLocation. This is also temporary.

Updates Haddock submodule

- - - - -


12 changed files:

- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/db811ddf798dd8a52ded5acf5e53f4eeaeb42474

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/db811ddf798dd8a52ded5acf5e53f4eeaeb42474
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231111/d68b6c93/attachment.html>


More information about the ghc-commits mailing list