summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser.y
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2020-09-15 18:41:10 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-17 08:52:19 -0400
commit4f461e1a31263f052effd03738b11ea123512cb0 (patch)
tree12b8da539239bb11c60b04b5833e3aca21445a24 /compiler/GHC/Parser.y
parentc12b3041e533962b8d0ac9ee44e928f874c11671 (diff)
downloadhaskell-4f461e1a31263f052effd03738b11ea123512cb0.tar.gz
Parser.y: clarify treatment of @{-# UNPACK #-}
Before this patch, we had this parser production: ftype : ... | ftype PREFIX_AT tyarg { ... } And 'tyarg' is defined as follows: tyarg : atype { ... } | unpackedness atype { ... } So one might get the (false) impression that that parser production is intended to parse things like: F @{-# UNPACK #-} X However, the lexer wouldn't produce PREFIX_AT followed by 'unpackedness', as the '@' operator followed by '{-' is not considered prefix. Thus there's no point using 'tyarg' after PREFIX_AT, and a simple 'atype' will suffice: ftype : ... | ftype PREFIX_AT atype { ... } This change has no user-facing consequences. It just makes the grammar a bit more clear.
Diffstat (limited to 'compiler/GHC/Parser.y')
-rw-r--r--compiler/GHC/Parser.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y
index b8398dee7f..e5780cdc86 100644
--- a/compiler/GHC/Parser.y
+++ b/compiler/GHC/Parser.y
@@ -1981,7 +1981,7 @@ ftype :: { forall b. DisambTD b => PV (Located b) }
| tyop { failOpFewArgs $1 }
| ftype tyarg { $1 >>= \ $1 ->
mkHsAppTyPV $1 $2 }
- | ftype PREFIX_AT tyarg { $1 >>= \ $1 ->
+ | ftype PREFIX_AT atype { $1 >>= \ $1 ->
mkHsAppKindTyPV $1 (getLoc $2) $3 }
tyarg :: { LHsType GhcPs }