summaryrefslogtreecommitdiff
path: root/compiler/Language/Haskell/Syntax
diff options
context:
space:
mode:
authorromes <rodrigo.m.mesquita@gmail.com>2022-06-14 00:14:16 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-06 13:50:27 -0400
commit371c5ecf6898294f4e5bf91784dc794e7e16b7cc (patch)
tree85ff46ffd1af9b075d3291780058791167d3f32e /compiler/Language/Haskell/Syntax
parentacc1816b9153f134a3308d13b90d67bfcb123d87 (diff)
downloadhaskell-371c5ecf6898294f4e5bf91784dc794e7e16b7cc.tar.gz
TTG for HsTyLit
Add TTG parameter to `HsTyLit` to move the GHC-specific `SourceText` fields to the extension point and out of the base AST. Progress towards #21592
Diffstat (limited to 'compiler/Language/Haskell/Syntax')
-rw-r--r--compiler/Language/Haskell/Syntax/Extension.hs7
-rw-r--r--compiler/Language/Haskell/Syntax/Type.hs15
2 files changed, 13 insertions, 9 deletions
diff --git a/compiler/Language/Haskell/Syntax/Extension.hs b/compiler/Language/Haskell/Syntax/Extension.hs
index 74cdbb07e0..7bc4685194 100644
--- a/compiler/Language/Haskell/Syntax/Extension.hs
+++ b/compiler/Language/Haskell/Syntax/Extension.hs
@@ -662,6 +662,13 @@ type family XWildCardTy x
type family XXType x
-- ---------------------------------------------------------------------
+-- HsTyLit type families
+type family XNumTy x
+type family XStrTy x
+type family XCharTy x
+type family XXTyLit x
+
+-- ---------------------------------------------------------------------
-- HsForAllTelescope type families
type family XHsForAllVis x
type family XHsForAllInvis x
diff --git a/compiler/Language/Haskell/Syntax/Type.hs b/compiler/Language/Haskell/Syntax/Type.hs
index 9bd8aa90e2..8d3ed8b4dc 100644
--- a/compiler/Language/Haskell/Syntax/Type.hs
+++ b/compiler/Language/Haskell/Syntax/Type.hs
@@ -63,7 +63,6 @@ import {-# SOURCE #-} Language.Haskell.Syntax.Expr ( HsUntypedSplice )
import Language.Haskell.Syntax.Extension
import Language.Haskell.Syntax.Basic
-import GHC.Types.SourceText
import GHC.Types.Name.Reader ( RdrName )
import GHC.Core.DataCon( HsSrcBang(..), HsImplBang(..),
SrcStrictness(..), SrcUnpackedness(..) )
@@ -885,7 +884,7 @@ data HsType pass
-- For details on above see Note [exact print annotations] in GHC.Parser.Annotation
- | HsTyLit (XTyLit pass) HsTyLit -- A promoted numeric literal.
+ | HsTyLit (XTyLit pass) (HsTyLit pass) -- A promoted numeric literal.
-- ^ - 'GHC.Parser.Annotation.AnnKeywordId' : None
-- For details on above see Note [exact print annotations] in GHC.Parser.Annotation
@@ -909,14 +908,12 @@ data HsType pass
type HsCoreTy = Type
--- Note [Literal source text] in GHC.Types.Basic for SourceText fields in
--- the following
-- | Haskell Type Literal
-data HsTyLit
- = HsNumTy SourceText Integer
- | HsStrTy SourceText FastString
- | HsCharTy SourceText Char
- deriving Data
+data HsTyLit pass
+ = HsNumTy (XNumTy pass) Integer
+ | HsStrTy (XStrTy pass) FastString
+ | HsCharTy (XCharTy pass) Char
+ | XTyLit !(XXTyLit pass)
-- | Denotes the type of arrows in the surface language
data HsArrow pass