diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-09-15 18:41:10 +0300 |
---|---|---|
committer | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-09-15 18:53:05 +0300 |
commit | 05e1d4c1d4c6bec35ee99e94d259911e33eb87c6 (patch) | |
tree | 8e9908dd380df15363f0e882179a12d129b9d92f | |
parent | 07762eb5cfe735e131a7f017939a6b0ccfb28389 (diff) | |
download | haskell-wip/no-at-unpack.tar.gz |
Parser.y: clarify treatment of @{-# UNPACK #-}wip/no-at-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.
-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 50f63796ee..b71027699c 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 } |