diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2015-07-23 11:42:07 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-07-23 11:42:46 +0200 |
commit | 76e2341afdc050549067a18cac41373f64daf4c2 (patch) | |
tree | 6df84605bf2ca7ed2d629958c2a47b4bb4463fcd /compiler/hsSyn/HsDecls.hs | |
parent | d2b4df157532adf014789ae9b2496f88369e43ea (diff) | |
download | haskell-76e2341afdc050549067a18cac41373f64daf4c2.tar.gz |
Accept next-docstrings on GADT constructors.
Accept next docstrings (`-- | Docstring`) on GADT constructors.
I have confirmed that this adds no shift/reduce conflicts.
Test Plan: haddockA034
Reviewers: austin, simonpj, simonmar
Reviewed By: simonmar
Subscribers: Fuuzetsu, simonmar, thomie, mpickering, edsko
Differential Revision: https://phabricator.haskell.org/D1086
Diffstat (limited to 'compiler/hsSyn/HsDecls.hs')
-rw-r--r-- | compiler/hsSyn/HsDecls.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 9233f4fde1..79b0deeb16 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -981,16 +981,17 @@ pprConDecl (ConDecl { con_names = cons, con_explicit = expl, con_qvars = tvs pprConDecl (ConDecl { con_names = cons, con_explicit = expl, con_qvars = tvs , con_cxt = cxt, con_details = PrefixCon arg_tys - , con_res = ResTyGADT _ res_ty }) - = ppr_con_names cons <+> dcolon <+> + , con_res = ResTyGADT _ res_ty, con_doc = doc }) + = ppr_mbDoc doc <+> ppr_con_names cons <+> dcolon <+> sep [pprHsForAll expl tvs cxt, ppr (foldr mk_fun_ty res_ty arg_tys)] where mk_fun_ty a b = noLoc (HsFunTy a b) pprConDecl (ConDecl { con_names = cons, con_explicit = expl, con_qvars = tvs , con_cxt = cxt, con_details = RecCon fields - , con_res = ResTyGADT _ res_ty }) - = sep [ppr_con_names cons <+> dcolon <+> pprHsForAll expl tvs cxt, + , con_res = ResTyGADT _ res_ty, con_doc = doc }) + = sep [ppr_mbDoc doc <+> ppr_con_names cons <+> dcolon + <+> pprHsForAll expl tvs cxt, pprConDeclFields (unLoc fields) <+> arrow <+> ppr res_ty] pprConDecl decl@(ConDecl { con_details = InfixCon ty1 ty2, con_res = ResTyGADT {} }) |