summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2022-05-15 14:27:36 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-06-20 17:34:44 -0400
commitd24afd9d7139d7a62f3b465af1be50b25c15e5b5 (patch)
tree914187fdbd3161c1734765b7f81a0172faff3779 /utils
parentb5590fff75496356b1817adc9de1f2d361a70dc5 (diff)
downloadhaskell-d24afd9d7139d7a62f3b465af1be50b25c15e5b5.tar.gz
HsToken for @-patterns and TypeApplications (#19623)
One more step towards the new design of EPA.
Diffstat (limited to 'utils')
-rw-r--r--utils/check-exact/ExactPrint.hs20
-rw-r--r--utils/check-exact/Lookup.hs2
-rw-r--r--utils/check-exact/Types.hs2
3 files changed, 10 insertions, 14 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs
index 05c6a1e792..9d5f932f1e 100644
--- a/utils/check-exact/ExactPrint.hs
+++ b/utils/check-exact/ExactPrint.hs
@@ -1837,7 +1837,7 @@ instance ExactPrint (HsExpr GhcPs) where
getAnnotationEntry (HsLam _ _) = NoEntryVal
getAnnotationEntry (HsLamCase an _ _) = fromAnn an
getAnnotationEntry (HsApp an _ _) = fromAnn an
- getAnnotationEntry (HsAppType _ _ _) = NoEntryVal
+ getAnnotationEntry (HsAppType _ _ _ _) = NoEntryVal
getAnnotationEntry (OpApp an _ _ _) = fromAnn an
getAnnotationEntry (NegApp an _ _) = fromAnn an
getAnnotationEntry (HsPar an _ _ _) = fromAnn an
@@ -1912,9 +1912,9 @@ instance ExactPrint (HsExpr GhcPs) where
debugM $ "HsApp entered. p=" ++ show p
markAnnotated e1
markAnnotated e2
- exact (HsAppType ss fun arg) = do
+ exact (HsAppType _ fun at arg) = do
markAnnotated fun
- printStringAtSs ss "@"
+ markToken at
markAnnotated arg
exact (OpApp _an e1 e2 e3) = do
markAnnotated e1
@@ -3547,7 +3547,7 @@ instance ExactPrint (Pat GhcPs) where
getAnnotationEntry (WildPat _) = NoEntryVal
getAnnotationEntry (VarPat _ _) = NoEntryVal
getAnnotationEntry (LazyPat an _) = fromAnn an
- getAnnotationEntry (AsPat an _ _) = fromAnn an
+ getAnnotationEntry (AsPat an _ _ _) = fromAnn an
getAnnotationEntry (ParPat an _ _ _) = fromAnn an
getAnnotationEntry (BangPat an _) = fromAnn an
getAnnotationEntry (ListPat an _) = fromAnn an
@@ -3573,9 +3573,9 @@ instance ExactPrint (Pat GhcPs) where
exact (LazyPat an pat) = do
markEpAnn an AnnTilde
markAnnotated pat
- exact (AsPat an n pat) = do
+ exact (AsPat _an n at pat) = do
markAnnotated n
- markEpAnn an AnnAt
+ markToken at
markAnnotated pat
exact (ParPat _an lpar pat rpar) = do
markToken lpar
@@ -3633,10 +3633,7 @@ instance ExactPrint (Pat GhcPs) where
instance ExactPrint (HsPatSigType GhcPs) where
getAnnotationEntry = const NoEntryVal
-
- exact (HsPS an ty) = do
- markAnnKw an id AnnAt
- markAnnotated ty
+ exact (HsPS _ ty) = markAnnotated ty
-- ---------------------------------------------------------------------
@@ -3693,6 +3690,9 @@ exactUserCon an c details = do
exactConArgs details
markEpAnn an AnnCloseC
+instance ExactPrint (HsConPatTyArg GhcPs) where
+ getAnnotationEntry _ = NoEntryVal
+ exact (HsConPatTyArg at tyarg) = markToken at >> markAnnotated tyarg
exactConArgs ::HsConPatDetails GhcPs -> EPP ()
exactConArgs (PrefixCon tyargs pats) = markAnnotated tyargs >> markAnnotated pats
diff --git a/utils/check-exact/Lookup.hs b/utils/check-exact/Lookup.hs
index 3cd53be04c..467f76c686 100644
--- a/utils/check-exact/Lookup.hs
+++ b/utils/check-exact/Lookup.hs
@@ -33,7 +33,6 @@ keywordToString kw =
(G AnnValStr ) -> mkErr kw
(G AnnName ) -> mkErr kw
(G AnnAs ) -> "as"
- (G AnnAt ) -> "@"
(G AnnBang ) -> "!"
(G AnnBackquote ) -> "`"
(G AnnBy ) -> "by"
@@ -126,5 +125,4 @@ keywordToString kw =
(G AnnRarrowtailU) -> "⤜"
(G AnnlarrowtailU) -> "⤙"
(G AnnrarrowtailU) -> "⤚"
- AnnTypeApp -> "@"
(G AnnVia) -> "via"
diff --git a/utils/check-exact/Types.hs b/utils/check-exact/Types.hs
index ef08421583..b9c6981671 100644
--- a/utils/check-exact/Types.hs
+++ b/utils/check-exact/Types.hs
@@ -156,7 +156,6 @@ instance Outputable Comment where
-- AST.
data KeywordId = G AnnKeywordId -- ^ A normal keyword
| AnnSemiSep -- ^ A separating comma
- | AnnTypeApp -- ^ Visible type application annotation
| AnnComment Comment
| AnnString String -- ^ Used to pass information from
-- Delta to Print when we have to work
@@ -167,7 +166,6 @@ data KeywordId = G AnnKeywordId -- ^ A normal keyword
instance Show KeywordId where
show (G gc) = "(G " ++ show gc ++ ")"
show AnnSemiSep = "AnnSemiSep"
- show AnnTypeApp = "AnnTypeApp"
show (AnnComment dc) = "(AnnComment " ++ show dc ++ ")"
show (AnnString s) = "(AnnString " ++ s ++ ")"