summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser/Annotation.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Parser/Annotation.hs')
-rw-r--r--compiler/GHC/Parser/Annotation.hs10
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/GHC/Parser/Annotation.hs b/compiler/GHC/Parser/Annotation.hs
index abece56898..19925b0678 100644
--- a/compiler/GHC/Parser/Annotation.hs
+++ b/compiler/GHC/Parser/Annotation.hs
@@ -621,18 +621,12 @@ data TrailingAnn
= AddSemiAnn EpaLocation -- ^ Trailing ';'
| AddCommaAnn EpaLocation -- ^ Trailing ','
| AddVbarAnn EpaLocation -- ^ Trailing '|'
- | AddRarrowAnn EpaLocation -- ^ Trailing '->'
- | AddRarrowAnnU EpaLocation -- ^ Trailing '->', unicode variant
- | AddLollyAnnU EpaLocation -- ^ Trailing '⊸'
deriving (Data,Show,Eq, Ord)
instance Outputable TrailingAnn where
ppr (AddSemiAnn ss) = text "AddSemiAnn" <+> ppr ss
ppr (AddCommaAnn ss) = text "AddCommaAnn" <+> ppr ss
ppr (AddVbarAnn ss) = text "AddVbarAnn" <+> ppr ss
- ppr (AddRarrowAnn ss) = text "AddRarrowAnn" <+> ppr ss
- ppr (AddRarrowAnnU ss) = text "AddRarrowAnnU" <+> ppr ss
- ppr (AddLollyAnnU ss) = text "AddLollyAnnU" <+> ppr ss
-- | Annotation for items appearing in a list. They can have one or
-- more trailing punctuations items, such as commas or semicolons.
@@ -1016,7 +1010,6 @@ setPriorComments (EpaCommentsBalanced _ ts) cs = EpaCommentsBalanced cs ts
-- Comment-only annotations
-- ---------------------------------------------------------------------
--- TODO:AZ I think EpAnnCO is not needed
type EpAnnCO = EpAnn NoEpAnns -- ^ Api Annotations for comments only
data NoEpAnns = NoEpAnns
@@ -1127,6 +1120,9 @@ instance Semigroup EpAnnComments where
instance (Monoid a) => Monoid (EpAnn a) where
mempty = EpAnnNotUsed
+instance Semigroup NoEpAnns where
+ _ <> _ = NoEpAnns
+
instance Semigroup AnnListItem where
(AnnListItem l1) <> (AnnListItem l2) = AnnListItem (l1 <> l2)