diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-11-12 09:22:39 +0300 |
---|---|---|
committer | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-11-28 15:47:53 +0300 |
commit | 6985e0fc4f6fb30c1effd356d87c1a0629aa9cd0 (patch) | |
tree | 00eb27d79c8730339e39215c7306caa3ff5fd14e /compiler/hieFile | |
parent | 6c59cc71dc20f26d5a6650b16a82faeae72f2065 (diff) | |
download | haskell-wip/hs-prag.tar.gz |
Factor out HsSCC/HsCoreAnn/HsTickPragma into HsPragEwip/hs-prag
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) }
Diffstat (limited to 'compiler/hieFile')
-rw-r--r-- | compiler/hieFile/HieAst.hs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/hieFile/HieAst.hs b/compiler/hieFile/HieAst.hs index c62ab0ae83..40bb914d31 100644 --- a/compiler/hieFile/HieAst.hs +++ b/compiler/hieFile/HieAst.hs @@ -978,10 +978,7 @@ instance ( a ~ GhcPass p ArithSeq _ _ info -> [ toHie info ] - HsSCC _ _ _ expr -> - [ toHie expr - ] - HsCoreAnn _ _ _ expr -> + HsPragE _ _ expr -> [ toHie expr ] HsProc _ pat cmdtop -> @@ -997,9 +994,6 @@ instance ( a ~ GhcPass p HsBinTick _ _ _ expr -> [ toHie expr ] - HsTickPragma _ _ _ _ expr -> - [ toHie expr - ] HsWrap _ _ a -> [ toHie $ L mspan a ] |