summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2019-05-14 15:04:02 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-05-23 22:43:12 -0400
commit6eedbd83a19cad94414b37f984b6e9c2b0c0b2e4 (patch)
treef9558c084950b8879dbe2e42f2703aeb820e1071 /compiler/parser
parent59f4cb6fb73ade6f9b0bdc85380dfddba93bf14b (diff)
downloadhaskell-6eedbd83a19cad94414b37f984b6e9c2b0c0b2e4.tar.gz
Some forall-related cleanup in deriving code
* Tweak the parser to allow `deriving` clauses to mention explicit `forall`s or kind signatures without gratuitous parentheses. (This fixes #14332 as a consequence.) * Allow Haddock comments on `deriving` clauses with explicit `forall`s. This requires corresponding changes in Haddock.
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Parser.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index c2dae02afc..087474f9af 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -2086,9 +2086,9 @@ inst_type :: { LHsSigType GhcPs }
: sigtype { mkLHsSigType $1 }
deriv_types :: { [LHsSigType GhcPs] }
- : typedoc { [mkLHsSigType $1] }
+ : ktypedoc { [mkLHsSigType $1] }
- | typedoc ',' deriv_types {% addAnnotation (gl $1) AnnComma (gl $2)
+ | ktypedoc ',' deriv_types {% addAnnotation (gl $1) AnnComma (gl $2)
>> return (mkLHsSigType $1 : $3) }
comma_types0 :: { [LHsType GhcPs] } -- Zero or more: ty,ty,ty