[Git][ghc/ghc][wip/az/locateda-epa-improve-2023-07-15] 18 commits: EPA Use full range for Anchor, and do not widen for [TrailingAnn]

Alan Zimmerman (@alanz) gitlab at gitlab.haskell.org
Thu Jul 20 17:32:42 UTC 2023



Alan Zimmerman pushed to branch wip/az/locateda-epa-improve-2023-07-15 at Glasgow Haskell Compiler / GHC


Commits:
e08e8385 by Alan Zimmerman at 2023-07-19T22:08:30+01:00
EPA Use full range for Anchor, and do not widen for [TrailingAnn]
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   2023-07-19 20:35:37 +0100

Summary: Patch:  summary-epa-use-full-range-for
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   2023-07-19 20:35:37 +0100

EPA Use full range for Anchor, and do not widen for [TrailingAnn]
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   2023-07-19 20:34:57 +0100

EPA Use full range for Anchor, and do not widen for [TrailingAnn]

info: patch template saved to `-`

- - - - -
f4635fcb by Alan Zimmerman at 2023-07-19T23:11:33+01:00
EPA: Move TrailingAnns from last match to FunBind

- - - - -
38249f50 by Alan Zimmerman at 2023-07-19T23:21:43+01:00
Put BufSpan into RealSrcSpan

This has been superseded by !9473, which moved BufSpan into EpaSpan in
EpaLocation

Start on making LocatedN more direct

Using EpaLocation instead of Anchor

Via a synonym initially, to prove the concept

Variants of AnnSortKey

For future, just a list of which type comes next.
Example for ValBinds

EPA: Explicitly capture EOF Location in AnnsModule

And also get rid of EpaEofComment.

- - - - -
c3c6a412 by Alan Zimmerman at 2023-07-19T23:21:46+01:00
[EPA] Simplify noAnnSrcSpanDP0

- - - - -
17ed6237 by Alan Zimmerman at 2023-07-19T23:23:26+01:00
Clean up addTrailingCommaN

Remove unused parameter

- - - - -
ae7c012f by Alan Zimmerman at 2023-07-19T23:23:30+01:00
Summary: Patch:  use-anchor-end-as-prior-end
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   2023-06-25 12:41:37 +0100

EPA: Use the current Anchor end as prior end

Use the original anchor location end as the source of truth for
calculating print deltas.

This allows original spacing to apply in most cases, only changed AST
items need initial delta positions.

- - - - -
b9741291 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
[EPA] Introduce HasTrailing in ExactPrint

Just plumbed through, not being used yet

- - - - -
680f5f61 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA use [TrailingAnn] in enterAnn

And remove it from ExactPrint (LocatedN RdrName)

- - - - -
492d4483 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA: In HsDo, put TrailingAnns at top of LastStmt

- - - - -
31e96f70 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA: Move TrailingAnns to the top of FieldOcc

- - - - -
5ef0e920 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA: Fix simple tests

- - - - -
cf0a8713 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA: do not convert comments to deltas when balancing.

It seems its not needed with the new approach

- - - - -
6f56213a by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA: Improve annotation management in getMonoBind

Ensure the LHsDecl for a FunBind has the correct leading comments and
trailing annotations.

See the added note for details.

- - - - -
717a8bb5 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA: deal with fallout from getMonoBind

- - - - -
3a6732a4 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA fix captureLineSpacing

- - - - -
934ae598 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA print any comments in the span before exiting it

- - - - -
b9405051 by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA: getting rid of tweakDelta

WIP at present

- - - - -
2698fa3c by Alan Zimmerman at 2023-07-19T23:23:30+01:00
EPA: Add '=>' to TrailingAnn

This is used as a trailing annotation in a context.
Add its normal and unicode variants.

Note that we keep the parsed representation the same, but make use of
it when exact printing.

- - - - -


23 changed files:

- compiler/GHC/Data/BooleanFormula.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Extension.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Utils.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Parser.y


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a361f8269f8440fe65f7ad187c88717780ba3dbd...2698fa3c0210691b2b77af166c6bc5cd9959bbc8

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a361f8269f8440fe65f7ad187c88717780ba3dbd...2698fa3c0210691b2b77af166c6bc5cd9959bbc8
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/20230720/8b465be9/attachment.html>


More information about the ghc-commits mailing list