Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

9 changed files:

Changes:

  • compiler/GHC/Hs/Decls.hs
    ... ... @@ -1528,7 +1528,7 @@ instance OutputableBndrId p
    1528 1528
     ************************************************************************
    
    1529 1529
     -}
    
    1530 1530
     
    
    1531
    -type instance XHsAnnotation (GhcPass _) = (AnnPragma, SourceText)
    
    1531
    +type instance XHsAnnotation (GhcPass _) = (AnnAnnDecl, SourceText)
    
    1532 1532
     type instance XXAnnDecl     (GhcPass _) = DataConCantHappen
    
    1533 1533
     
    
    1534 1534
     instance (OutputableBndrId p) => Outputable (AnnDecl (GhcPass p)) where
    

  • compiler/GHC/Hs/Decls/Overlap.hs
    ... ... @@ -26,7 +26,7 @@ import GHC.Prelude
    26 26
     
    
    27 27
     import GHC.Hs.Extension
    
    28 28
     
    
    29
    -import GHC.Parser.Annotation ( AnnPragma )
    
    29
    +import GHC.Parser.Annotation ( AnnOverlap )
    
    30 30
     
    
    31 31
     import Language.Haskell.Syntax.Decls.Overlap
    
    32 32
     import Language.Haskell.Syntax.Extension
    
    ... ... @@ -67,8 +67,8 @@ instance NFData OverlapFlag where
    67 67
     instance Outputable OverlapFlag where
    
    68 68
         ppr flag = ppr (overlapMode flag) <+> pprSafeOverlap (isSafeOverlap flag)
    
    69 69
     
    
    70
    -type instance XOverlapMode  GhcPs = (SourceText, AnnPragma)
    
    71
    -type instance XOverlapMode  GhcRn = (SourceText, AnnPragma)
    
    70
    +type instance XOverlapMode  GhcPs = (SourceText, AnnOverlap)
    
    71
    +type instance XOverlapMode  GhcRn = (SourceText, AnnOverlap)
    
    72 72
     type instance XOverlapMode  GhcTc = SourceText
    
    73 73
     
    
    74 74
     type instance XXOverlapMode (GhcPass _) = DataConCantHappen
    

  • compiler/GHC/Hs/Expr.hs
    ... ... @@ -612,7 +612,7 @@ instance NoAnn AnnFunRhs where
    612 612
     
    
    613 613
     -- ---------------------------------------------------------------------
    
    614 614
     
    
    615
    -type instance XSCC           (GhcPass _) = (AnnPragma, SourceText)
    
    615
    +type instance XSCC           (GhcPass _) = (AnnPragSCC, SourceText)
    
    616 616
     type instance XXPragE        (GhcPass _) = DataConCantHappen
    
    617 617
     
    
    618 618
     type instance XCDotFieldOcc (GhcPass _) = AnnFieldLabel
    

  • compiler/GHC/Parser.y
    ... ... @@ -1473,13 +1473,13 @@ inst_decl :: { LInstDecl GhcPs }
    1473 1473
     
    
    1474 1474
     overlap_pragma :: { Maybe (LocatedA (OverlapMode GhcPs)) }
    
    1475 1475
       : '{-# OVERLAPPABLE'    '#-}' {% fmap Just $ amsA' (sLL $1 $> (Overlappable (getOVERLAPPABLE_PRAGs $1,
    
    1476
    -                                       AnnPragma (glR $1) (epTok $2) noAnn noAnn noAnn noAnn noAnn))) }
    
    1476
    +                                       AnnOverlap (glR $1) (epTok $2)))) }
    
    1477 1477
       | '{-# OVERLAPPING'     '#-}' {% fmap Just $ amsA' (sLL $1 $> (Overlapping (getOVERLAPPING_PRAGs $1,
    
    1478
    -                                       AnnPragma (glR $1) (epTok $2) noAnn noAnn noAnn noAnn noAnn))) }
    
    1478
    +                                       AnnOverlap (glR $1) (epTok $2)))) }
    
    1479 1479
       | '{-# OVERLAPS'        '#-}' {% fmap Just $ amsA' (sLL $1 $> (Overlaps (getOVERLAPS_PRAGs $1,
    
    1480
    -                                       AnnPragma (glR $1) (epTok $2) noAnn noAnn noAnn noAnn noAnn))) }
    
    1480
    +                                       AnnOverlap (glR $1) (epTok $2)))) }
    
    1481 1481
       | '{-# INCOHERENT'      '#-}' {% fmap Just $ amsA' (sLL $1 $> (Incoherent (getINCOHERENT_PRAGs $1,
    
    1482
    -                                       AnnPragma (glR $1) (epTok $2) noAnn noAnn noAnn noAnn noAnn))) }
    
    1482
    +                                       AnnOverlap (glR $1) (epTok $2)))) }
    
    1483 1483
       | {- empty -}                 { Nothing }
    
    1484 1484
     
    
    1485 1485
     deriv_strategy_no_via :: { LDerivStrategy GhcPs }
    
    ... ... @@ -1710,13 +1710,13 @@ datafam_inst_hdr :: { Located (Maybe (LHsContext GhcPs), HsOuterFamEqnTyVarBndrs
    1710 1710
     capi_ctype :: { Maybe (LocatedA (CType GhcPs)) }
    
    1711 1711
     capi_ctype : '{-# CTYPE' STRING STRING '#-}'
    
    1712 1712
                            {% fmap Just $ amsA' (sLL $1 $> (mkCType (getCTYPEs $1) (getSTRINGs $3)
    
    1713
    -                                                                (AnnPragma (glR $1) (epTok $4) noAnn (glR $2) (glR $3) noAnn noAnn)
    
    1713
    +                                                                (AnnCType (glR $1) (epTok $4) (glR $2) (glR $3))
    
    1714 1714
                                                                     (Just (Header (getSTRINGs $2) (getSTRING $2)))
    
    1715 1715
                                                                     (getSTRING $3)))}
    
    1716 1716
     
    
    1717 1717
                | '{-# CTYPE'        STRING '#-}'
    
    1718 1718
                            {% fmap Just $ amsA' (sLL $1 $> (mkCType (getCTYPEs $1) (getSTRINGs $2)
    
    1719
    -                                                                (AnnPragma (glR $1) (epTok $3) noAnn noAnn (glR $2) noAnn noAnn)
    
    1719
    +                                                                (AnnCType (glR $1) (epTok $3) noAnn (glR $2))
    
    1720 1720
                                                                     Nothing (getSTRING $2)))}
    
    1721 1721
     
    
    1722 1722
                |           { Nothing }
    
    ... ... @@ -2078,11 +2078,11 @@ to varid (used for rule_vars), 'checkRuleTyVarBndrNames' must be updated.
    2078 2078
     maybe_warning_pragma :: { Maybe (LWarningTxt GhcPs) }
    
    2079 2079
             : '{-# DEPRECATED' strings '#-}'
    
    2080 2080
                                 {% fmap Just $ amsA' (sLL $1 $> $
    
    2081
    -                                DeprecatedTxt (getDEPRECATED_PRAGs $1, AnnPragma (glR $1) (epTok $3) (fst $ unLoc $2) noAnn noAnn noAnn noAnn)
    
    2081
    +                                DeprecatedTxt (getDEPRECATED_PRAGs $1, AnnWarningTxt (glR $1) (epTok $3) (fst $ unLoc $2))
    
    2082 2082
                                                   (snd $ unLoc $2))}
    
    2083 2083
             | '{-# WARNING' warning_category strings '#-}'
    
    2084 2084
                                 {% fmap Just $ amsA' (sLL $1 $> $
    
    2085
    -                                WarningTxt (getWARNING_PRAGs $1, AnnPragma (glR $1) (epTok $4) (fst $ unLoc $3) noAnn noAnn noAnn noAnn)
    
    2085
    +                                WarningTxt (getWARNING_PRAGs $1, AnnWarningTxt (glR $1) (epTok $4) (fst $ unLoc $3))
    
    2086 2086
                                                $2 (snd $ unLoc $3))}
    
    2087 2087
             |  {- empty -}      { Nothing }
    
    2088 2088
     
    
    ... ... @@ -2165,19 +2165,19 @@ stringlist :: { Located (OrdList (LocatedA (WithHsDocIdentifiers (StringLiteral
    2165 2165
     annotation :: { LHsDecl GhcPs }
    
    2166 2166
         : '{-# ANN' name_var aexp '#-}'      {% runPV (unECP $3) >>= \ $3 ->
    
    2167 2167
                                                 amsA' (sLL $1 $> (AnnD noExtField $ HsAnnotation
    
    2168
    -                                            (AnnPragma (glR $1) (epTok $4) noAnn noAnn noAnn noAnn noAnn,
    
    2168
    +                                            (AnnAnnDecl (glR $1) (epTok $4) noAnn noAnn,
    
    2169 2169
                                                 (getANN_PRAGs $1))
    
    2170 2170
                                                 (ValueAnnProvenance $2) $3)) }
    
    2171 2171
     
    
    2172 2172
         | '{-# ANN' 'type' otycon aexp '#-}' {% runPV (unECP $4) >>= \ $4 ->
    
    2173 2173
                                                 amsA' (sLL $1 $> (AnnD noExtField $ HsAnnotation
    
    2174
    -                                            (AnnPragma (glR $1) (epTok $5) noAnn noAnn noAnn (epTok $2) noAnn,
    
    2174
    +                                            (AnnAnnDecl (glR $1) (epTok $5) (epTok $2) noAnn,
    
    2175 2175
                                                 (getANN_PRAGs $1))
    
    2176 2176
                                                 (TypeAnnProvenance $3) $4)) }
    
    2177 2177
     
    
    2178 2178
         | '{-# ANN' 'module' aexp '#-}'      {% runPV (unECP $3) >>= \ $3 ->
    
    2179 2179
                                                 amsA' (sLL $1 $> (AnnD noExtField $ HsAnnotation
    
    2180
    -                                                (AnnPragma (glR $1) (epTok $4) noAnn noAnn noAnn noAnn (epTok $2),
    
    2180
    +                                                (AnnAnnDecl (glR $1) (epTok $4) noAnn (epTok $2),
    
    2181 2181
                                                     (getANN_PRAGs $1))
    
    2182 2182
                                                      ModuleAnnProvenance $3)) }
    
    2183 2183
     
    
    ... ... @@ -3052,12 +3052,12 @@ prag_e :: { Located (HsPragE GhcPs) }
    3052 3052
           : '{-# SCC' STRING '#-}'      {% do { scc <- getSCC $2
    
    3053 3053
                                               ; return (sLL $1 $>
    
    3054 3054
                                                  (HsPragSCC
    
    3055
    -                                                (AnnPragma (glR $1) (epTok $3) noAnn (glR $2) noAnn noAnn noAnn,
    
    3055
    +                                                (AnnPragSCC (glR $1) (epTok $3) (glR $2),
    
    3056 3056
                                                     (getSCC_PRAGs $1))
    
    3057 3057
                                                     (StringLiteral (getSTRINGs $2) scc)))} }
    
    3058 3058
           | '{-# SCC' VARID  '#-}'      { sLL $1 $>
    
    3059 3059
                                                  (HsPragSCC
    
    3060
    -                                               (AnnPragma (glR $1) (epTok $3) noAnn (glR $2) noAnn noAnn noAnn,
    
    3060
    +                                               (AnnPragSCC (glR $1) (epTok $3) (glR $2),
    
    3061 3061
                                                    (getSCC_PRAGs $1))
    
    3062 3062
                                                    (StringLiteral NoSourceText (fastStringToShortText $ getVARID $2))) }
    
    3063 3063
     
    

  • compiler/GHC/Parser/Annotation.hs
    ... ... @@ -36,7 +36,7 @@ module GHC.Parser.Annotation (
    36 36
     
    
    37 37
       AnnList(..), AnnListBrackets(..),
    
    38 38
       AnnParen(..),
    
    39
    -  AnnPragma(..),
    
    39
    +  AnnCType(..),AnnWarningTxt(..),AnnOverlap(..),AnnAnnDecl(..),AnnPragSCC(..),
    
    40 40
       AnnBooleanFormula(..),
    
    41 41
       NameAnn(..), NameAdornment(..),
    
    42 42
       NoEpAnns(..),
    
    ... ... @@ -627,15 +627,40 @@ data NameAdornment
    627 627
     
    
    628 628
     -- | exact print annotation used for capturing the locations of
    
    629 629
     -- annotations in pragmas.
    
    630
    -data AnnPragma
    
    631
    -  = AnnPragma {
    
    632
    -      apr_open      :: EpaLocation,
    
    633
    -      apr_close     :: EpToken "#-}",
    
    634
    -      apr_squares   :: (EpToken "[", EpToken "]"),
    
    635
    -      apr_loc1      :: EpaLocation,
    
    636
    -      apr_loc2      :: EpaLocation,
    
    637
    -      apr_type      :: EpToken "type",
    
    638
    -      apr_module    :: EpToken "module"
    
    630
    +data AnnCType
    
    631
    +  = AnnCType {
    
    632
    +      ac_open      :: EpaLocation,
    
    633
    +      ac_close     :: EpToken "#-}",
    
    634
    +      ac_loc1      :: EpaLocation,
    
    635
    +      ac_loc2      :: EpaLocation
    
    636
    +      } deriving (Data,Eq)
    
    637
    +
    
    638
    +data AnnWarningTxt
    
    639
    +  = AnnWarningTxt {
    
    640
    +      awt_open      :: EpaLocation,
    
    641
    +      awt_close     :: EpToken "#-}",
    
    642
    +      awt_squares   :: (EpToken "[", EpToken "]")
    
    643
    +      } deriving (Data,Eq)
    
    644
    +
    
    645
    +data AnnOverlap
    
    646
    +  = AnnOverlap {
    
    647
    +      ao_open      :: EpaLocation,
    
    648
    +      ao_close     :: EpToken "#-}"
    
    649
    +      } deriving (Data,Eq)
    
    650
    +
    
    651
    +data AnnAnnDecl
    
    652
    +  = AnnAnnDecl {
    
    653
    +      ad_open      :: EpaLocation,
    
    654
    +      ad_close     :: EpToken "#-}",
    
    655
    +      ad_type      :: EpToken "type",
    
    656
    +      ad_module    :: EpToken "module"
    
    657
    +      } deriving (Data,Eq)
    
    658
    +
    
    659
    +data AnnPragSCC
    
    660
    +  = AnnPragSCC {
    
    661
    +      aps_open      :: EpaLocation,
    
    662
    +      aps_close     :: EpToken "#-}",
    
    663
    +      aps_loc1      :: EpaLocation
    
    639 664
           } deriving (Data,Eq)
    
    640 665
     
    
    641 666
     -- ---------------------------------------------------------------------
    
    ... ... @@ -1020,8 +1045,20 @@ instance NoAnn a => NoAnn (AnnList a) where
    1020 1045
     instance NoAnn NameAnn where
    
    1021 1046
       noAnn = NameAnnTrailing []
    
    1022 1047
     
    
    1023
    -instance NoAnn AnnPragma where
    
    1024
    -  noAnn = AnnPragma noAnn noAnn noAnn noAnn noAnn noAnn noAnn
    
    1048
    +instance NoAnn AnnCType where
    
    1049
    +  noAnn = AnnCType noAnn noAnn noAnn noAnn
    
    1050
    +
    
    1051
    +instance NoAnn AnnWarningTxt where
    
    1052
    +  noAnn = AnnWarningTxt noAnn noAnn noAnn
    
    1053
    +
    
    1054
    +instance NoAnn AnnOverlap where
    
    1055
    +  noAnn = AnnOverlap noAnn noAnn
    
    1056
    +
    
    1057
    +instance NoAnn AnnAnnDecl where
    
    1058
    +  noAnn = AnnAnnDecl noAnn noAnn noAnn noAnn
    
    1059
    +
    
    1060
    +instance NoAnn AnnPragSCC where
    
    1061
    +  noAnn = AnnPragSCC noAnn noAnn noAnn
    
    1025 1062
     
    
    1026 1063
     instance NoAnn AnnParen where
    
    1027 1064
       noAnn = AnnParens noAnn noAnn
    
    ... ... @@ -1107,7 +1144,23 @@ instance Outputable AnnListBrackets where
    1107 1144
       ppr (ListBanana o c) = text "ListBanana" <+> ppr o <+> ppr c
    
    1108 1145
       ppr ListNone         = text "ListNone"
    
    1109 1146
     
    
    1110
    -instance Outputable AnnPragma where
    
    1111
    -  ppr (AnnPragma o c s l ca t m)
    
    1112
    -    = text "AnnPragma" <+> ppr o <+> ppr c <+> ppr s <+> ppr l
    
    1113
    -                       <+> ppr ca <+> ppr ca <+> ppr t <+> ppr m
    1147
    +instance Outputable AnnCType where
    
    1148
    +  ppr (AnnCType o c l ca)
    
    1149
    +    = text "AnnCType" <+> ppr o <+> ppr c <+> ppr l
    
    1150
    +                       <+> ppr ca <+> ppr ca
    
    1151
    +
    
    1152
    +instance Outputable AnnWarningTxt where
    
    1153
    +  ppr (AnnWarningTxt o c s)
    
    1154
    +    = text "AnnWarningTxt" <+> ppr o <+> ppr c <+> ppr s
    
    1155
    +
    
    1156
    +instance Outputable AnnOverlap where
    
    1157
    +  ppr (AnnOverlap o c)
    
    1158
    +    = text "AnnOverlap" <+> ppr o <+> ppr c
    
    1159
    +
    
    1160
    +instance Outputable AnnAnnDecl where
    
    1161
    +  ppr (AnnAnnDecl o c t m)
    
    1162
    +    = text "AnnAnnDecl" <+> ppr o <+> ppr c <+> ppr t <+> ppr m
    
    1163
    +
    
    1164
    +instance Outputable AnnPragSCC where
    
    1165
    +  ppr (AnnPragSCC o c l)
    
    1166
    +    = text "AnnPragSCC" <+> ppr o <+> ppr c <+> ppr l

  • compiler/GHC/Types/ForeignCall.hs
    ... ... @@ -109,7 +109,7 @@ import Data.Data (Data)
    109 109
     import Data.Functor ((<&>))
    
    110 110
     
    
    111 111
     import Control.DeepSeq (NFData(..))
    
    112
    -import GHC.Parser.Annotation (AnnPragma, noAnn)
    
    112
    +import GHC.Parser.Annotation (AnnCType, noAnn)
    
    113 113
     
    
    114 114
     {-
    
    115 115
     ************************************************************************
    
    ... ... @@ -216,7 +216,7 @@ defaultCType :: String -> CType (GhcPass p)
    216 216
     defaultCType =
    
    217 217
       CType (CTypeGhc NoSourceText NoSourceText noAnn) Nothing . packHText
    
    218 218
     
    
    219
    -mkCType :: SourceText -> SourceText -> AnnPragma -> Maybe (Header (GhcPass p)) -> HText -> CType (GhcPass p)
    
    219
    +mkCType :: SourceText -> SourceText -> AnnCType -> Maybe (Header (GhcPass p)) -> HText -> CType (GhcPass p)
    
    220 220
     mkCType x y ann m =
    
    221 221
       CType (CTypeGhc x y ann) m
    
    222 222
     
    
    ... ... @@ -303,7 +303,7 @@ data StaticTargetGhc = StaticTargetGhc
    303 303
     data CTypeGhc = CTypeGhc
    
    304 304
       { cTypeSourceText :: SourceText
    
    305 305
       , cTypeOtherText  :: SourceText
    
    306
    -  , cTypeAnn        :: AnnPragma
    
    306
    +  , cTypeAnn        :: AnnCType
    
    307 307
       }
    
    308 308
       deriving (Data, Eq)
    
    309 309
     
    

  • compiler/GHC/Unit/Module/Warnings.hs
    ... ... @@ -158,8 +158,8 @@ warningTxtSame w1 w2
    158 158
     instance Outputable (InWarningCategory (GhcPass pass)) where
    
    159 159
       ppr (InWarningCategory _ wt) = text "in" <+> doubleQuotes (ppr wt)
    
    160 160
     
    
    161
    -type instance XDeprecatedTxt       (GhcPass _) = (SourceText, AnnPragma)
    
    162
    -type instance XWarningTxt          (GhcPass _) = (SourceText, AnnPragma)
    
    161
    +type instance XDeprecatedTxt       (GhcPass _) = (SourceText, AnnWarningTxt)
    
    162
    +type instance XWarningTxt          (GhcPass _) = (SourceText, AnnWarningTxt)
    
    163 163
     type instance XXWarningTxt         (GhcPass _) = DataConCantHappen
    
    164 164
     type instance XInWarningCategory   (GhcPass _) = (EpToken "in", SourceText)
    
    165 165
     type instance XXInWarningCategory  (GhcPass _) = DataConCantHappen
    

  • utils/check-exact/ExactPrint.hs
    ... ... @@ -288,10 +288,6 @@ instance HasTrailing [TrailingAnn] where
    288 288
       trailing a = a
    
    289 289
       setTrailing _ ts = ts
    
    290 290
     
    
    291
    -instance HasTrailing AnnPragma where
    
    292
    -  trailing _ = []
    
    293
    -  setTrailing a _ = a
    
    294
    -
    
    295 291
     instance HasTrailing AnnParen where
    
    296 292
       trailing _ = []
    
    297 293
       setTrailing a _ = a
    
    ... ... @@ -1559,22 +1555,22 @@ instance ExactPrint (WarningTxt GhcPs) where
    1559 1555
       getAnnotationEntry _ = NoEntryVal
    
    1560 1556
       setAnnotationAnchor a _ _ _ = a
    
    1561 1557
     
    
    1562
    -  exact (WarningTxt (src, AnnPragma o c (os,cs) l1 l2 t m) mb_cat ws) = do
    
    1558
    +  exact (WarningTxt (src, AnnWarningTxt o c (os,cs)) mb_cat ws) = do
    
    1563 1559
         o' <- markAnnOpen'' o src "{-# WARNING"
    
    1564 1560
         mb_cat' <- markAnnotated mb_cat
    
    1565 1561
         os' <- markEpToken os
    
    1566 1562
         ws' <- mapM markAnnotated ws
    
    1567 1563
         cs' <- markEpToken cs
    
    1568 1564
         c' <- markEpToken c
    
    1569
    -    return (WarningTxt (src, AnnPragma o' c' (os',cs') l1 l2 t m) mb_cat' ws')
    
    1565
    +    return (WarningTxt (src, AnnWarningTxt o' c' (os',cs')) mb_cat' ws')
    
    1570 1566
     
    
    1571
    -  exact (DeprecatedTxt (src, AnnPragma o c (os,cs) l1 l2 t m) ws) = do
    
    1567
    +  exact (DeprecatedTxt (src, AnnWarningTxt o c (os,cs)) ws) = do
    
    1572 1568
         o' <- markAnnOpen'' o src "{-# DEPRECATED"
    
    1573 1569
         os' <- markEpToken os
    
    1574 1570
         ws' <- mapM markAnnotated ws
    
    1575 1571
         cs' <- markEpToken cs
    
    1576 1572
         c' <- markEpToken c
    
    1577
    -    return (DeprecatedTxt (src, AnnPragma o' c' (os',cs') l1 l2 t m) ws')
    
    1573
    +    return (DeprecatedTxt (src, AnnWarningTxt o' c' (os',cs')) ws')
    
    1578 1574
     
    
    1579 1575
     instance ExactPrint (InWarningCategory GhcPs) where
    
    1580 1576
       getAnnotationEntry _ = NoEntryVal
    
    ... ... @@ -2251,35 +2247,35 @@ instance ExactPrint (OverlapMode GhcPs) where
    2251 2247
       setAnnotationAnchor a _ _ _ = a
    
    2252 2248
     
    
    2253 2249
       -- NOTE: NoOverlap is only used in the typechecker
    
    2254
    -  exact (NoOverlap (src, AnnPragma o c s l1 l2 t m)) = do
    
    2250
    +  exact (NoOverlap (src, AnnOverlap o c)) = do
    
    2255 2251
         o' <- markAnnOpen'' o src "{-# NO_OVERLAP"
    
    2256 2252
         c' <- markEpToken c
    
    2257
    -    return (NoOverlap (src, AnnPragma o' c' s l1 l2 t m))
    
    2253
    +    return (NoOverlap (src, AnnOverlap o' c'))
    
    2258 2254
     
    
    2259
    -  exact (Overlappable (src, AnnPragma o c s l1 l2 t m)) = do
    
    2255
    +  exact (Overlappable (src, AnnOverlap o c)) = do
    
    2260 2256
         o' <- markAnnOpen'' o src "{-# OVERLAPPABLE"
    
    2261 2257
         c' <- markEpToken c
    
    2262
    -    return (Overlappable (src, AnnPragma o' c' s l1 l2 t m))
    
    2258
    +    return (Overlappable (src, AnnOverlap o' c'))
    
    2263 2259
     
    
    2264
    -  exact (Overlapping (src, AnnPragma o c s l1 l2 t m)) = do
    
    2260
    +  exact (Overlapping (src, AnnOverlap o c)) = do
    
    2265 2261
         o' <- markAnnOpen'' o src "{-# OVERLAPPING"
    
    2266 2262
         c' <- markEpToken c
    
    2267
    -    return (Overlapping (src, AnnPragma o' c' s l1 l2 t m))
    
    2263
    +    return (Overlapping (src, AnnOverlap o' c'))
    
    2268 2264
     
    
    2269
    -  exact (Overlaps (src, AnnPragma o c s l1 l2 t m)) = do
    
    2265
    +  exact (Overlaps (src, AnnOverlap o c)) = do
    
    2270 2266
         o' <- markAnnOpen'' o src "{-# OVERLAPS"
    
    2271 2267
         c' <- markEpToken c
    
    2272
    -    return (Overlaps (src, AnnPragma o' c' s l1 l2 t m))
    
    2268
    +    return (Overlaps (src, AnnOverlap o' c'))
    
    2273 2269
     
    
    2274
    -  exact (Incoherent (src, AnnPragma o c s l1 l2 t m)) = do
    
    2270
    +  exact (Incoherent (src, AnnOverlap o c)) = do
    
    2275 2271
         o' <- markAnnOpen'' o src "{-# INCOHERENT"
    
    2276 2272
         c' <- markEpToken c
    
    2277
    -    return (Incoherent (src, AnnPragma o' c' s l1 l2 t m))
    
    2273
    +    return (Incoherent (src, AnnOverlap o' c'))
    
    2278 2274
     
    
    2279
    -  exact (NonCanonical (src, AnnPragma o c s l1 l2 t m)) = do
    
    2275
    +  exact (NonCanonical (src, AnnOverlap o c)) = do
    
    2280 2276
         o' <- markAnnOpen'' o src "{-# INCOHERENT"
    
    2281 2277
         c' <- markEpToken c
    
    2282
    -    return (Incoherent (src, AnnPragma o' c' s l1 l2 t m))
    
    2278
    +    return (Incoherent (src, AnnOverlap o' c'))
    
    2283 2279
     
    
    2284 2280
     -- ---------------------------------------------------------------------
    
    2285 2281
     
    
    ... ... @@ -2706,7 +2702,7 @@ instance ExactPrint (AnnDecl GhcPs) where
    2706 2702
       getAnnotationEntry _ = NoEntryVal
    
    2707 2703
       setAnnotationAnchor a _ _ _ = a
    
    2708 2704
     
    
    2709
    -  exact (HsAnnotation (AnnPragma o c s l1 l2 t m, src) prov e) = do
    
    2705
    +  exact (HsAnnotation (AnnAnnDecl o c t m, src) prov e) = do
    
    2710 2706
         o' <- markAnnOpen'' o src "{-# ANN"
    
    2711 2707
         (t', m', prov') <-
    
    2712 2708
           case prov of
    
    ... ... @@ -2723,7 +2719,7 @@ instance ExactPrint (AnnDecl GhcPs) where
    2723 2719
     
    
    2724 2720
         e' <- markAnnotated e
    
    2725 2721
         c' <- markEpToken c
    
    2726
    -    return (HsAnnotation (AnnPragma o' c' s l1 l2 t' m',src) prov' e')
    
    2722
    +    return (HsAnnotation (AnnAnnDecl o' c' t' m',src) prov' e')
    
    2727 2723
     
    
    2728 2724
     -- ---------------------------------------------------------------------
    
    2729 2725
     
    
    ... ... @@ -3146,11 +3142,11 @@ instance ExactPrint (HsPragE GhcPs) where
    3146 3142
       getAnnotationEntry HsPragSCC{}  = NoEntryVal
    
    3147 3143
       setAnnotationAnchor a _ _ _ = a
    
    3148 3144
     
    
    3149
    -  exact (HsPragSCC (AnnPragma o c s l1 l2 t m,st) sl) = do
    
    3145
    +  exact (HsPragSCC (AnnPragSCC o c l1,st) sl) = do
    
    3150 3146
         o' <- markAnnOpen'' o st  "{-# SCC"
    
    3151 3147
         l1' <- printStringAtAA l1 (sourceTextToString (stringLitSourceText sl) (unpackHText $ sl_fs sl))
    
    3152 3148
         c' <- markEpToken c
    
    3153
    -    return (HsPragSCC (AnnPragma o' c' s l1' l2 t m,st) sl)
    
    3149
    +    return (HsPragSCC (AnnPragSCC o' c' l1',st) sl)
    
    3154 3150
     
    
    3155 3151
     instance ExactPrint (HsTypedSplice GhcPs) where
    
    3156 3152
       getAnnotationEntry _ = NoEntryVal
    
    ... ... @@ -4408,7 +4404,7 @@ instance Typeable p => ExactPrint (CType (GhcPass p)) where
    4408 4404
       exact (CType ext mh ct) = do
    
    4409 4405
         let stp  = cTypeSourceText ext
    
    4410 4406
             stct = cTypeOtherText  ext
    
    4411
    -        AnnPragma o c s l1 l2 t m = cTypeAnn ext
    
    4407
    +        AnnCType o c l1 l2 = cTypeAnn ext
    
    4412 4408
         o' <- markAnnOpen'' o stp "{-# CTYPE"
    
    4413 4409
         l1' <- case mh of
    
    4414 4410
                  Nothing -> return l1
    
    ... ... @@ -4416,7 +4412,7 @@ instance Typeable p => ExactPrint (CType (GhcPass p)) where
    4416 4412
                    printStringAtAA l1 (toSourceTextWithSuffix srcH "" "")
    
    4417 4413
         l2' <- printStringAtAA l2 (toSourceTextWithSuffix stct (unpackHText ct) "")
    
    4418 4414
         c' <- markEpToken c
    
    4419
    -    return (CType (ext { cTypeAnn = AnnPragma o' c' s l1' l2' t m }) mh ct)
    
    4415
    +    return (CType (ext { cTypeAnn = AnnCType o' c' l1' l2' }) mh ct)
    
    4420 4416
     
    
    4421 4417
     -- ---------------------------------------------------------------------
    
    4422 4418
     
    

  • utils/haddock/haddock-api/src/Haddock/Types.hs
    ... ... @@ -838,7 +838,7 @@ type instance Anno (HsSigType DocNameI) = SrcSpanAnnA
    838 838
     type instance Anno (BooleanFormula DocNameI) = SrcSpanAnnBF
    
    839 839
     type instance Anno (OverlapMode DocNameI) = SrcSpanAnnA
    
    840 840
     type instance Anno (CType DocNameI) = SrcSpanAnnA
    
    841
    -type instance Anno (Header DocNameI) = EpAnn AnnPragma
    
    841
    +type instance Anno (Header DocNameI) = SrcSpanAnnA
    
    842 842
     type instance Anno (HsModifierOf (LocatedA (HsType DocNameI)) DocNameI) = SrcSpanAnnA
    
    843 843
     type instance Anno (HsContextDetails DocNameI a) = SrcSpanAnnA
    
    844 844