summaryrefslogtreecommitdiff
path: root/src/Language/Haskell/GHC/ExactPrint/Parsers.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language/Haskell/GHC/ExactPrint/Parsers.hs')
-rw-r--r--src/Language/Haskell/GHC/ExactPrint/Parsers.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Language/Haskell/GHC/ExactPrint/Parsers.hs b/src/Language/Haskell/GHC/ExactPrint/Parsers.hs
index 86cf19d..4037ef3 100644
--- a/src/Language/Haskell/GHC/ExactPrint/Parsers.hs
+++ b/src/Language/Haskell/GHC/ExactPrint/Parsers.hs
@@ -190,7 +190,11 @@ parseModuleFromStringInternal
parseModuleFromStringInternal dflags fileName str =
let (str1, lp) = stripLinePragmas str
res = case runParser GHC.parseModule dflags fileName str1 of
+#if __GLASGOW_HASKELL__ >= 804
+ GHC.PFailed _ ss m -> Left (ss, GHC.showSDoc dflags m)
+#else
GHC.PFailed ss m -> Left (ss, GHC.showSDoc dflags m)
+#endif
GHC.POk x pmod -> Right $ (mkApiAnns x, lp, dflags, pmod)
in postParseTransform res normalLayout