diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2022-04-01 14:33:55 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-08 13:56:27 -0400 |
commit | 3415981c36631115bc1d7fb5b51abfcc2932a12f (patch) | |
tree | 9546cc5fa07432c16aa60902250a1ad19a6c227c /compiler/GHC/Parser | |
parent | 85f4a3c9c2635e71a9ab0b723774ec993fefb93d (diff) | |
download | haskell-3415981c36631115bc1d7fb5b51abfcc2932a12f.tar.gz |
HsUniToken for :: in GADT constructors (#19623)
One more step towards the new design of EPA.
Updates the haddock submodule.
Diffstat (limited to 'compiler/GHC/Parser')
-rw-r--r-- | compiler/GHC/Parser/PostProcess.hs | 7 | ||||
-rw-r--r-- | compiler/GHC/Parser/PostProcess/Haddock.hs | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index c39cc478af..1530e9ab12 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -723,10 +723,10 @@ mkConDeclH98 ann name mb_forall mb_cxt args -- Note [GADT abstract syntax] in "GHC.Hs.Decls" for more details. mkGadtDecl :: SrcSpan -> [LocatedN RdrName] + -> LHsUniToken "::" "∷" GhcPs -> LHsSigType GhcPs - -> [AddEpAnn] -> P (LConDecl GhcPs) -mkGadtDecl loc names ty annsIn = do +mkGadtDecl loc names dcol ty = do cs <- getCommentsFor loc let l = noAnnSrcSpan loc @@ -746,11 +746,12 @@ mkGadtDecl loc names ty annsIn = do let (anns, cs, arg_types, res_type) = splitHsFunType body_ty return (PrefixConGADT arg_types, res_type, anns, cs) - let an = EpAnn (spanAsAnchor loc) (annsIn ++ annsa) (cs Semi.<> csa) + let an = EpAnn (spanAsAnchor loc) annsa (cs Semi.<> csa) pure $ L l ConDeclGADT { con_g_ext = an , con_names = names + , con_dcolon = dcol , con_bndrs = L (getLoc ty) outer_bndrs , con_mb_cxt = mcxt , con_g_args = args diff --git a/compiler/GHC/Parser/PostProcess/Haddock.hs b/compiler/GHC/Parser/PostProcess/Haddock.hs index 271d9db30f..72403ef018 100644 --- a/compiler/GHC/Parser/PostProcess/Haddock.hs +++ b/compiler/GHC/Parser/PostProcess/Haddock.hs @@ -696,7 +696,7 @@ instance HasHaddock (LocatedA (ConDecl GhcPs)) where addHaddock (L l_con_decl con_decl) = extendHdkA (locA l_con_decl) $ case con_decl of - ConDeclGADT { con_g_ext, con_names, con_bndrs, con_mb_cxt, con_g_args, con_res_ty } -> do + ConDeclGADT { con_g_ext, con_names, con_dcolon, con_bndrs, con_mb_cxt, con_g_args, con_res_ty } -> do -- discardHasInnerDocs is ok because we don't need this info for GADTs. con_doc' <- discardHasInnerDocs $ getConDoc (getLocA (head con_names)) con_g_args' <- @@ -708,7 +708,7 @@ instance HasHaddock (LocatedA (ConDecl GhcPs)) where pure $ RecConGADT (L l_rec flds') arr con_res_ty' <- addHaddock con_res_ty pure $ L l_con_decl $ - ConDeclGADT { con_g_ext, con_names, con_bndrs, con_mb_cxt, + ConDeclGADT { con_g_ext, con_names, con_dcolon, con_bndrs, con_mb_cxt, con_doc = lexLHsDocString <$> con_doc', con_g_args = con_g_args', con_res_ty = con_res_ty' } |