From 6985e0fc4f6fb30c1effd356d87c1a0629aa9cd0 Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Tue, 12 Nov 2019 09:22:39 +0300 Subject: Factor out HsSCC/HsCoreAnn/HsTickPragma into HsPragE This is a refactoring with no user-visible changes (except for GHC API users). Consider the HsExpr constructors that correspond to user-written pragmas: HsSCC representing {-# SCC ... #-} HsCoreAnn representing {-# CORE ... #-} HsTickPragma representing {-# GENERATED ... #-} We can factor them out into a separate datatype, HsPragE. It makes the code a bit tidier, especially in the parser. Before this patch: hpc_annot :: { Located ( (([AddAnn],SourceText),(StringLiteral,(Int,Int),(Int,Int))), ((SourceText,SourceText),(SourceText,SourceText)) ) } After this patch: prag_hpc :: { Located ([AddAnn], HsPragE GhcPs) } --- compiler/GHC/Hs/Extension.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/GHC/Hs/Extension.hs') diff --git a/compiler/GHC/Hs/Extension.hs b/compiler/GHC/Hs/Extension.hs index 6b1042700a..be0333933a 100644 --- a/compiler/GHC/Hs/Extension.hs +++ b/compiler/GHC/Hs/Extension.hs @@ -606,8 +606,6 @@ type family XRecordCon x type family XRecordUpd x type family XExprWithTySig x type family XArithSeq x -type family XSCC x -type family XCoreAnn x type family XBracket x type family XRnBracketOut x type family XTcBracketOut x @@ -616,10 +614,15 @@ type family XProc x type family XStatic x type family XTick x type family XBinTick x -type family XTickPragma x +type family XPragE x type family XWrap x type family XXExpr x +type family XSCC x +type family XCoreAnn x +type family XTickPragma x +type family XXPragE x + type ForallXExpr (c :: * -> Constraint) (x :: *) = ( c (XVar x) , c (XUnboundVar x) -- cgit v1.2.1