summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-api/annotations/stringSource.hs
diff options
context:
space:
mode:
authorJosh Meredith <joshmeredith2008@gmail.com>2019-12-04 23:39:28 +1100
committerJosh Meredith <joshmeredith2008@gmail.com>2019-12-04 23:39:28 +1100
commita8435165b84c32fd2ebdd1281dd6ee077e07ad5a (patch)
tree791936d014aeaa26174c2dcbef34c14f3329dd04 /testsuite/tests/ghc-api/annotations/stringSource.hs
parent7805441b4d5e22eb63a501e1e40383d10380dc92 (diff)
parentf03a41d4bf9418ee028ecb51654c928b2da74edd (diff)
downloadhaskell-wip/binary-readerT.tar.gz
Merge branch 'master' into wip/binary-readerTwip/binary-readerT
Diffstat (limited to 'testsuite/tests/ghc-api/annotations/stringSource.hs')
-rw-r--r--testsuite/tests/ghc-api/annotations/stringSource.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/testsuite/tests/ghc-api/annotations/stringSource.hs b/testsuite/tests/ghc-api/annotations/stringSource.hs
index 8bae838672..3d053a3d7c 100644
--- a/testsuite/tests/ghc-api/annotations/stringSource.hs
+++ b/testsuite/tests/ghc-api/annotations/stringSource.hs
@@ -80,11 +80,15 @@ testOneFile libdir fileName = do
doCCallTarget (StaticTarget s f _ _) = [("st",[(noLoc (s,f))])]
doHsExpr :: HsExpr GhcPs -> [(String,[Located (SourceText,FastString)])]
- doHsExpr (HsCoreAnn _ src ss _) = [("co",[conv (noLoc ss)])]
- doHsExpr (HsSCC _ src ss _) = [("sc",[conv (noLoc ss)])]
- doHsExpr (HsTickPragma _ src (ss,_,_) _ss2 _) = [("tp",[conv (noLoc ss)])]
+ doHsExpr (HsPragE _ prag _) = doPragE prag
doHsExpr _ = []
+ doPragE :: HsPragE GhcPs -> [(String,[Located (SourceText,FastString)])]
+ doPragE (HsPragCore _ src ss) = [("co",[conv (noLoc ss)])]
+ doPragE (HsPragSCC _ src ss) = [("sc",[conv (noLoc ss)])]
+ doPragE (HsPragTick _ src (ss,_,_) _ss2) = [("tp",[conv (noLoc ss)])]
+ doPragE (XHsPragE x) = noExtCon x
+
conv (GHC.L l (StringLiteral st fs)) = GHC.L l (st,fs)
showAnns anns = "[\n" ++ (intercalate "\n"