summaryrefslogtreecommitdiff
path: root/compiler/parser/RdrHsSyn.hs
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2019-04-29 22:36:23 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-15 18:29:05 -0400
commit284a2f44666c88616c9f4426e566014f8685669c (patch)
treed2fcc71b00bf73067f77b3585125658ab36056ce /compiler/parser/RdrHsSyn.hs
parent0670f98adafdc863bc51b59b276668cfef60b365 (diff)
downloadhaskell-284a2f44666c88616c9f4426e566014f8685669c.tar.gz
Decouple AddAnn from P
Diffstat (limited to 'compiler/parser/RdrHsSyn.hs')
-rw-r--r--compiler/parser/RdrHsSyn.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs
index b16858de56..b0d493c559 100644
--- a/compiler/parser/RdrHsSyn.hs
+++ b/compiler/parser/RdrHsSyn.hs
@@ -266,7 +266,7 @@ mkDataFamInst :: SrcSpan
mkDataFamInst loc new_or_data cType (mcxt, bndrs, tycl_hdr)
ksig data_cons maybe_deriv
= do { (tc, tparams, fixity, ann) <- checkTyClHdr False tycl_hdr
- ; mapM_ (\a -> a loc) ann -- Add any API Annotations to the top SrcSpan
+ ; addAnnsAt loc ann -- Add any API Annotations to the top SrcSpan
; defn <- mkDataDefn new_or_data cType mcxt ksig data_cons maybe_deriv
; return (cL loc (DataFamInstD noExtField (DataFamInstDecl (mkHsImplicitBndrs
(FamEqn { feqn_ext = noExtField
@@ -1374,12 +1374,12 @@ pStrictMark ((dL->L l1 x1) : (dL->L l2 x2) : xs)
| Just (strAnnId, str) <- tyElStrictness x1
, TyElUnpackedness (unpkAnns, prag, unpk) <- x2
= Just ( cL (combineSrcSpans l1 l2) (HsSrcBang prag unpk str)
- , unpkAnns ++ [\s -> addAnnotation s strAnnId l1]
+ , unpkAnns ++ [AddAnn strAnnId l1]
, xs )
pStrictMark ((dL->L l x1) : xs)
| Just (strAnnId, str) <- tyElStrictness x1
= Just ( cL l (HsSrcBang NoSourceText NoSrcUnpack str)
- , [\s -> addAnnotation s strAnnId l]
+ , [AddAnn strAnnId l]
, xs )
pStrictMark ((dL->L l x1) : xs)
| TyElUnpackedness (anns, prag, unpk) <- x1
@@ -3025,8 +3025,6 @@ instance MonadP PV where
PV $ ReaderT $ \ctxMsg -> addFatalError srcspan (msg $$ ctxMsg)
getBit ext =
PV $ ReaderT $ \_ -> getBit ext
- addAnnsAt loc anns =
- PV $ ReaderT $ \_ -> addAnnsAt loc anns
addAnnotation l a v =
PV $ ReaderT $ \_ -> addAnnotation l a v