diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-09-15 18:41:10 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-09-17 08:52:19 -0400 |
commit | 4f461e1a31263f052effd03738b11ea123512cb0 (patch) | |
tree | 12b8da539239bb11c60b04b5833e3aca21445a24 /compiler/GHC/Parser.y | |
parent | c12b3041e533962b8d0ac9ee44e928f874c11671 (diff) | |
download | haskell-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.y | 2 |
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 } |