diff options
Diffstat (limited to 'testsuite/tests/ghc-api/annotations-literals')
3 files changed, 37 insertions, 25 deletions
diff --git a/testsuite/tests/ghc-api/annotations-literals/literals.stdout b/testsuite/tests/ghc-api/annotations-literals/literals.stdout index 077c570f2b..0e8ce7c9dc 100644 --- a/testsuite/tests/ghc-api/annotations-literals/literals.stdout +++ b/testsuite/tests/ghc-api/annotations-literals/literals.stdout @@ -24,7 +24,7 @@ (LiteralsTest.hs:5:3,ITequal,[=]), -(LiteralsTest.hs:5:5-8,ITinteger "0003" 3,[0003]), +(LiteralsTest.hs:5:5-8,ITinteger (SourceText "0003") 3,[0003]), (LiteralsTest.hs:6:1,ITsemi,[]), @@ -32,7 +32,7 @@ (LiteralsTest.hs:6:3,ITequal,[=]), -(LiteralsTest.hs:6:5-8,ITinteger "0x04" 4,[0x04]), +(LiteralsTest.hs:6:5-8,ITinteger (SourceText "0x04") 4,[0x04]), (LiteralsTest.hs:8:1,ITsemi,[]), @@ -48,7 +48,7 @@ (LiteralsTest.hs:9:3,ITequal,[=]), -(LiteralsTest.hs:9:5-10,ITstring "\"\\x20\"" " ",["\x20"]), +(LiteralsTest.hs:9:5-10,ITstring (SourceText "\"\\x20\"") " ",["\x20"]), (LiteralsTest.hs:11:1,ITsemi,[]), @@ -64,7 +64,7 @@ (LiteralsTest.hs:12:3,ITequal,[=]), -(LiteralsTest.hs:12:5-10,ITchar "'\\x20'" ' ',['\x20']), +(LiteralsTest.hs:12:5-10,ITchar (SourceText "'\\x20'") ' ',['\x20']), (LiteralsTest.hs:14:1,ITsemi,[]), @@ -98,7 +98,7 @@ (LiteralsTest.hs:19:11,ITequal,[=]), -(LiteralsTest.hs:19:13-19,ITprimchar "'\\x41'" 'A',['\x41'#]), +(LiteralsTest.hs:19:13-19,ITprimchar (SourceText "'\\x41'") 'A',['\x41'#]), (LiteralsTest.hs:20:5,ITsemi,[]), @@ -106,7 +106,7 @@ (LiteralsTest.hs:20:10,ITequal,[=]), -(LiteralsTest.hs:20:12-16,ITprimint "0004#" 4,[0004#]), +(LiteralsTest.hs:20:12-16,ITprimint (SourceText "0004#") 4,[0004#]), (LiteralsTest.hs:21:5,ITsemi,[]), @@ -114,7 +114,7 @@ (LiteralsTest.hs:21:11,ITequal,[=]), -(LiteralsTest.hs:21:13-17,ITprimword "005##" 5,[005##]), +(LiteralsTest.hs:21:13-17,ITprimword (SourceText "005##") 5,[005##]), (LiteralsTest.hs:22:5,ITsemi,[]), @@ -138,7 +138,7 @@ (LiteralsTest.hs:24:7,ITequal,[=]), -(LiteralsTest.hs:24:9,ITinteger "1" 1,[1]), +(LiteralsTest.hs:24:9,ITinteger (SourceText "1") 1,[1]), (LiteralsTest.hs:25:1,ITvccurly,[]), diff --git a/testsuite/tests/ghc-api/annotations-literals/parsed.hs b/testsuite/tests/ghc-api/annotations-literals/parsed.hs index 8664fdcf13..0170bc2949 100644 --- a/testsuite/tests/ghc-api/annotations-literals/parsed.hs +++ b/testsuite/tests/ghc-api/annotations-literals/parsed.hs @@ -3,7 +3,7 @@ -- argument. module Main where --- import Data.Generics +import BasicTypes import Data.Data import Data.List import System.IO @@ -42,21 +42,33 @@ testOneFile libdir fileName = do gq ast = everything (++) ([] `mkQ` doHsLit `extQ` doOverLit) ast doHsLit :: HsLit -> [String] - doHsLit (HsChar src c) = ["HsChar [" ++ src ++ "] " ++ show c] - doHsLit (HsCharPrim src c) = ["HsCharPrim [" ++ src ++ "] " ++ show c] - doHsLit (HsString src c) = ["HsString [" ++ src ++ "] " ++ show c] - doHsLit (HsStringPrim src c) = ["HsStringPrim [" ++ src ++ "] " ++ show c] - doHsLit (HsInt src c) = ["HsInt [" ++ src ++ "] " ++ show c] - doHsLit (HsIntPrim src c) = ["HsIntPrim [" ++ src ++ "] " ++ show c] - doHsLit (HsWordPrim src c) = ["HsWordPrim [" ++ src ++ "] " ++ show c] - doHsLit (HsInt64Prim src c) = ["HsInt64Prim [" ++ src ++ "] " ++ show c] - doHsLit (HsWord64Prim src c) = ["HsWord64Prim [" ++ src ++ "] " ++ show c] - doHsLit (HsInteger src c _) = ["HsInteger [" ++ src ++ "] " ++ show c] + doHsLit (HsChar (SourceText src) c) + = ["HsChar [" ++ src ++ "] " ++ show c] + doHsLit (HsCharPrim (SourceText src) c) + = ["HsCharPrim [" ++ src ++ "] " ++ show c] + doHsLit (HsString (SourceText src) c) + = ["HsString [" ++ src ++ "] " ++ show c] + doHsLit (HsStringPrim (SourceText src) c) + = ["HsStringPrim [" ++ src ++ "] " ++ show c] + doHsLit (HsInt (SourceText src) c) + = ["HsInt [" ++ src ++ "] " ++ show c] + doHsLit (HsIntPrim (SourceText src) c) + = ["HsIntPrim [" ++ src ++ "] " ++ show c] + doHsLit (HsWordPrim (SourceText src) c) + = ["HsWordPrim [" ++ src ++ "] " ++ show c] + doHsLit (HsInt64Prim (SourceText src) c) + = ["HsInt64Prim [" ++ src ++ "] " ++ show c] + doHsLit (HsWord64Prim (SourceText src) c) + = ["HsWord64Prim [" ++ src ++ "] " ++ show c] + doHsLit (HsInteger (SourceText src) c _) + = ["HsInteger [" ++ src ++ "] " ++ show c] doHsLit _ = [] doOverLit :: OverLitVal -> [String] - doOverLit (HsIntegral src c) = ["HsIntegral [" ++ src ++ "] " ++ show c] - doOverLit (HsIsString src c) = ["HsIsString [" ++ src ++ "] " ++ show c] + doOverLit (HsIntegral (SourceText src) c) + = ["HsIntegral [" ++ src ++ "] " ++ show c] + doOverLit (HsIsString (SourceText src) c) + = ["HsIsString [" ++ src ++ "] " ++ show c] doOverLit _ = [] pp a = showPpr unsafeGlobalDynFlags a diff --git a/testsuite/tests/ghc-api/annotations-literals/parsed.stdout b/testsuite/tests/ghc-api/annotations-literals/parsed.stdout index ce7a004929..7984181504 100644 --- a/testsuite/tests/ghc-api/annotations-literals/parsed.stdout +++ b/testsuite/tests/ghc-api/annotations-literals/parsed.stdout @@ -1,12 +1,12 @@ HsIntegral [0003] 3 -HsString [] "noExpr" +HsString [noExpr] "noExpr" HsIntegral [0x04] 4 -HsString [] "noExpr" +HsString [noExpr] "noExpr" HsString ["\x20"] " " HsChar ['\x20'] ' ' -HsString [] "noExpr" +HsString [noExpr] "noExpr" HsCharPrim ['\x41'] 'A' HsIntPrim [0004#] 4 HsWordPrim [005##] 5 HsIntegral [1] 1 -HsString [] "noExpr" +HsString [noExpr] "noExpr" |