summaryrefslogtreecommitdiff
path: root/compiler/GHC/Iface/Ext
diff options
context:
space:
mode:
authorAndrea Condoluci <andrea.condoluci@tweag.io>2021-09-27 09:47:29 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-30 00:57:09 -0400
commit205f0f921590a6365ed1c36d34f557a1e387bfa2 (patch)
treed6b85511dc4f1163f22cfeb91fceb39d890a9ddc /compiler/GHC/Iface/Ext
parentc261f2207cf85c8770dc46fcfc46e9b1ddb49589 (diff)
downloadhaskell-205f0f921590a6365ed1c36d34f557a1e387bfa2.tar.gz
Trees That Grow refactor for HsTick and HsBinTick
Move HsTick and HsBinTick to XExpr, the extension tree of HsExpr. Part of #16830 .
Diffstat (limited to 'compiler/GHC/Iface/Ext')
-rw-r--r--compiler/GHC/Iface/Ext/Ast.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs
index d20a7bb77f..90afbd9605 100644
--- a/compiler/GHC/Iface/Ext/Ast.hs
+++ b/compiler/GHC/Iface/Ext/Ast.hs
@@ -739,10 +739,10 @@ instance HiePass p => HasType (LocatedA (HsExpr (GhcPass p))) where
RecordCon con_expr _ _ -> computeType con_expr
ExprWithTySig _ e _ -> computeLType e
HsStatic _ e -> computeLType e
- HsTick _ _ e -> computeLType e
- HsBinTick _ _ _ e -> computeLType e
HsPragE _ _ e -> computeLType e
XExpr (ExpansionExpr (HsExpanded _ e)) -> computeType e
+ XExpr (HsTick _ e) -> computeLType e
+ XExpr (HsBinTick _ _ e) -> computeLType e
e -> Just (hsExprType e)
computeLType :: LHsExpr GhcTc -> Maybe Type
@@ -1190,12 +1190,6 @@ instance HiePass p => ToHie (LocatedA (HsExpr (GhcPass p))) where
HsStatic _ expr ->
[ toHie expr
]
- HsTick _ _ expr ->
- [ toHie expr
- ]
- HsBinTick _ _ _ expr ->
- [ toHie expr
- ]
HsBracket _ b ->
[ toHie b
]
@@ -1222,6 +1216,12 @@ instance HiePass p => ToHie (LocatedA (HsExpr (GhcPass p))) where
-> [ toHie (L mspan b) ]
ConLikeTc con _ _
-> [ toHie $ C Use $ L mspan $ conLikeName con ]
+ HsTick _ expr
+ -> [ toHie expr
+ ]
+ HsBinTick _ _ expr
+ -> [ toHie expr
+ ]
| otherwise -> []
-- NOTE: no longer have the location