[Git][ghc/ghc][wip/az/exactprint] 2 commits: Proof of Concept implementation of in-tree API Annotations
Alan Zimmerman
gitlab at gitlab.haskell.org
Sun Jul 19 22:39:55 UTC 2020
Alan Zimmerman pushed to branch wip/az/exactprint at Glasgow Haskell Compiler / GHC
Commits:
bc37f9ab by Alan Zimmerman at 2020-07-14T22:29: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
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.
Working on changing ApiAnnName to accurately reflect actual usage
Get rid of AnnApiName in favour of LocatedN
Working on check-exact. Making progress
Working on the ghc-exact bit
Progress, can reproduce the first Test.hs file.
Move API Annotations out of the extensions to annotations
- - - - -
fdc51196 by Alan Zimmerman at 2020-07-19T23:38:49+01:00
Remove LHsLocalBinds
- - - - -
20 changed files:
- .gitmodules
- compiler/GHC.hs
- compiler/GHC/Data/BooleanFormula.hs
- compiler/GHC/Data/OrdList.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Types.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
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ab141bcc82a3c1ad5873cb22d95bc6518b057628...fdc5119622740ad6eff59bc0dd6df4c51981f294
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ab141bcc82a3c1ad5873cb22d95bc6518b057628...fdc5119622740ad6eff59bc0dd6df4c51981f294
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/20200719/08f3b37c/attachment-0001.html>
More information about the ghc-commits
mailing list