[Git][ghc/ghc][wip/jade/ast] Refactor FieldOcc and AmbiguousFieldOcc with TTG

Hassan Al-Awwadi (@hassan.awwadi) gitlab at gitlab.haskell.org
Thu Oct 3 13:59:48 UTC 2024



Hassan Al-Awwadi pushed to branch wip/jade/ast at Glasgow Haskell Compiler / GHC


Commits:
f3a0573a by Hassan Al-Awwadi at 2024-10-03T15:46:10+02:00
Refactor FieldOcc and AmbiguousFieldOcc with TTG

The main purpose of this commit is to rip RdrName out of FieldOcc, and
to make the cases where the FieldOcc can be ambgiuous more precise.

To do the first, we make FieldOccs store (LIdP p) instead of always
storing Located RdrName, and moved the readername to the extension
points where necessary.

For the second we've renamed AmbiguousFieldOcc to UpdFieldOcc, but now
instead of having Ambiguous be a constantly present constructor, it has
been moved to the extension constructor XUpdFieldOcc, only present during
the Renaming stage.

See Note [Lifecycle of a UpdFieldOcc] for more details.

co-authored by: Jade <Jade512 at proton.me>
                Rodrigo Mesquita <rodrigo.m.mesquita at gmail.com>

- - - - -


30 changed files:

- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Extension.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Fixity.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Pat.hs


The diff was not included because it is too large.


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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f3a0573ae2c6d427b0f96ff8bbd29f29bf1efa07
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/20241003/129ee665/attachment.html>


More information about the ghc-commits mailing list