[Git][ghc/ghc][wip/az/exactprint] 2 commits: Proof of Concept implementation of in-tree API Annotations
Alan Zimmerman
gitlab at gitlab.haskell.org
Wed May 27 22:28:06 UTC 2020
Alan Zimmerman pushed to branch wip/az/exactprint at Glasgow Haskell Compiler / GHC
Commits:
24f83adc by Alan Zimmerman at 2020-05-25T22:27:33+01:00
Proof of Concept implementation of in-tree API Annotations
This MR introduces a possible machinery to introduce API Annotations
into the TTG extension points.
It is intended to be a concrete example for discussion.
It still needs to process comments.
----
Work in progress, adding more TTG extensions for annotations.
And fixing ppr round-trip tests by being able to blank out in-tree
annotations, as done with SrcSpans.
This is needed for the case of
class Foo a where
for which current ppr does not print the "where".
Rename AA to AddApiAnn and AA to AddAnn
Add XConPatIn and XConPatOut
Rebase
----
First pass at bringing in LocatedA for API anns in locations
Treatment of ECP in parsing is provisional at this stage, leads to some
horribly stuff in Parser.y and RdrHsSyn.
It is an extensive but not invasive change. I think (AZ).
Locally it reports some parsing tests using less memory.
Add ApiAnns to the HsExpr data structure.
rebase.
Change HsMatchContext and HsStmtContext to use an id, not a GhcPass
parameter.
Add ApiAnns to Hs/Types
Rebase
Rebased 2020-03-25
WIP on in-tree annotations
Includes updating HsModule
Imports
LocateA ImportDecl so we can hang AnnSemi off it
A whole bunch of stuff more
InjectivityAnn and FamEqn now have annotations in them
Add annotations to context srcspan
----
In-tree annotations: LHsDecl and LHsBind LocatedA
----
WIP on in-tree annotations
----
in-tree annotations: LHsType is now LocatedA
----
FunDeps is now also a HS data type
----
WIP. Added LocatedA to Pat, Expr, Decl
And worked some more through Parser.y
----
LStmt now Located
----
Finished working through Parser.y, tests seem ok
failures relate to annotations.
Adding test infrastructure for check-exact
Like check-ppr, but checking for an exact reproduction of the parsed
source file.
Starting to work on actual exact printer
- - - - -
fe6c414e by Alan Zimmerman at 2020-05-27T23:26:52+01:00
Bring in ApiAnnName
As an alternative for LocatedA, to be used for names only.
Carrying extra name adornments, such as locations of backticks,
parens, etc.
- - - - -
19 changed files:
- compiler/GHC/Data/BooleanFormula.hs
- compiler/GHC/Data/OrdList.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Dump.hs
- + compiler/GHC/Hs/Exact.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Expr.hs-boot
- compiler/GHC/Hs/Extension.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Stats.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/095800f7d9237d48dbcdaa90b92e8d07789b3d57...fe6c414e21eaa1ba7f0887c542e61f9c05f09565
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/095800f7d9237d48dbcdaa90b92e8d07789b3d57...fe6c414e21eaa1ba7f0887c542e61f9c05f09565
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/20200527/f533e871/attachment.html>
More information about the ghc-commits
mailing list