summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser.y
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2021-05-14 12:33:01 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-21 15:05:44 -0400
commit0da85d41ee6bc7f941cdbee8cebd5b57fa35396f (patch)
tree6dfb34ff0c0a46771defe0f65d9004eed9fd5cfd /compiler/GHC/Parser.y
parent6eed426bf24fe4ddc4c4802ff44b949e74f9d7ee (diff)
downloadhaskell-0da85d41ee6bc7f941cdbee8cebd5b57fa35396f.tar.gz
EPA: Fix explicit specificity and unicode linear arrow annotations
Closes #19839 Closes #19840
Diffstat (limited to 'compiler/GHC/Parser.y')
-rw-r--r--compiler/GHC/Parser.y9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y
index 44ca8fa042..38c5233ab4 100644
--- a/compiler/GHC/Parser.y
+++ b/compiler/GHC/Parser.y
@@ -2151,7 +2151,7 @@ type :: { LHsType GhcPs }
| btype '->.' ctype {% hintLinear (getLoc $2) >>
acsA (\cs -> sLL (reLoc $1) (reLoc $>)
- $ HsFunTy (EpAnn (glAR $1) (mau $2) cs) (HsLinearArrow UnicodeSyntax Nothing) $1 $3) }
+ $ HsFunTy (EpAnn (glAR $1) (mlu $2) cs) (HsLinearArrow UnicodeSyntax Nothing) $1 $3) }
-- [mu AnnLollyU $2] }
mult :: { Located (IsUnicodeSyntax -> HsArrow GhcPs) }
@@ -2271,8 +2271,8 @@ tv_bndrs :: { [LHsTyVarBndr Specificity GhcPs] }
tv_bndr :: { LHsTyVarBndr Specificity GhcPs }
: tv_bndr_no_braces { $1 }
- | '{' tyvar '}' {% acsA (\cs -> sLL $1 $> (UserTyVar (EpAnn (glR $1) [mop $1, mcp $3] cs) InferredSpec $2)) }
- | '{' tyvar '::' kind '}' {% acsA (\cs -> sLL $1 $> (KindedTyVar (EpAnn (glR $1) [mop $1,mu AnnDcolon $3 ,mcp $5] cs) InferredSpec $2 $4)) }
+ | '{' tyvar '}' {% acsA (\cs -> sLL $1 $> (UserTyVar (EpAnn (glR $1) [moc $1, mcc $3] cs) InferredSpec $2)) }
+ | '{' tyvar '::' kind '}' {% acsA (\cs -> sLL $1 $> (KindedTyVar (EpAnn (glR $1) [moc $1,mu AnnDcolon $3 ,mcc $5] cs) InferredSpec $2 $4)) }
tv_bndr_no_braces :: { LHsTyVarBndr Specificity GhcPs }
: tyvar {% acsA (\cs -> (sL1 (reLocN $1) (UserTyVar (EpAnn (glNR $1) [] cs) SpecifiedSpec $1))) }
@@ -4175,6 +4175,9 @@ mau :: Located Token -> TrailingAnn
mau lt@(L l t) = if isUnicode lt then AddRarrowAnnU (EpaSpan $ rs l)
else AddRarrowAnn (EpaSpan $ rs l)
+mlu :: Located Token -> TrailingAnn
+mlu lt@(L l t) = AddLollyAnnU (EpaSpan $ rs l)
+
-- | If the 'Token' is using its unicode variant return the unicode variant of
-- the annotation
toUnicodeAnn :: AnnKeywordId -> Located Token -> AnnKeywordId