summaryrefslogtreecommitdiff
path: root/compiler/GHC/Hs
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2021-10-02 03:15:14 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-04 23:46:21 -0400
commita762933454f1dbecaa2048f810f6ab6bbfe3a93d (patch)
tree05d54919ee3e2ccddb1b4ddce580afee479b620d /compiler/GHC/Hs
parenta0f44cebb217b3586d861750366301b973073dd1 (diff)
downloadhaskell-a762933454f1dbecaa2048f810f6ab6bbfe3a93d.tar.gz
Bespoke TokenLocation data type
The EpaAnnCO we were using contained an Anchor instead of EpaLocation, making it harder to work with. At the same time, using EpaLocation by itself isn't possible either, as we may have tokens without location information. Hence the new data type: data TokenLocation = NoTokenLoc | TokenLoc !EpaLocation
Diffstat (limited to 'compiler/GHC/Hs')
-rw-r--r--compiler/GHC/Hs/Extension.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/GHC/Hs/Extension.hs b/compiler/GHC/Hs/Extension.hs
index 841604ecb9..ce28e0355d 100644
--- a/compiler/GHC/Hs/Extension.hs
+++ b/compiler/GHC/Hs/Extension.hs
@@ -236,12 +236,12 @@ pprIfTc :: forall p. IsPass p => (p ~ 'Typechecked => SDoc) -> SDoc
pprIfTc pp = case ghcPass @p of GhcTc -> pp
_ -> empty
-type instance Anno (HsToken tok) = EpAnnCO
+type instance Anno (HsToken tok) = TokenLocation
-noHsTok :: GenLocated (EpAnn a) (HsToken tok)
-noHsTok = L noAnn HsTok
+noHsTok :: GenLocated TokenLocation (HsToken tok)
+noHsTok = L NoTokenLoc HsTok
-type instance Anno (HsUniToken tok utok) = EpAnnCO
+type instance Anno (HsUniToken tok utok) = TokenLocation
-noHsUniTok :: GenLocated (EpAnn a) (HsUniToken tok utok)
-noHsUniTok = L noAnn HsNormalTok
+noHsUniTok :: GenLocated TokenLocation (HsUniToken tok utok)
+noHsUniTok = L NoTokenLoc HsNormalTok