aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Hyperlinker
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-09-22 19:30:28 +0200
committerSylvain Henry <sylvain@haskus.fr>2020-09-30 11:02:33 +0200
commit7b5972402afad755cd45aaad1a96aac509e9d5d2 (patch)
treeb0ca70dfa338722a8eb6a548ac458212c22d15ae /haddock-api/src/Haddock/Backends/Hyperlinker
parenta18c3af7f983f3b6d3cd84093c9079031da58468 (diff)
Adapt to GHC parser changes
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Hyperlinker')
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
index d9746189..eb6c061c 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
@@ -13,6 +13,7 @@ import GHC.Types.Basic ( IntegralLit(..) )
import GHC.Driver.Session
import GHC.Utils.Error ( pprLocErrMsg )
import GHC.Data.FastString ( mkFastString )
+import GHC.Parser.Errors.Ppr ( pprError )
import GHC.Parser.Lexer as Lexer
( P(..), ParseResult(..), PState(..), Token(..)
, initParserState, lexer, mkParserOpts, getErrorMessages)
@@ -39,7 +40,7 @@ parse
parse dflags fpath bs = case unP (go False []) initState of
POk _ toks -> reverse toks
PFailed pst ->
- let err:_ = bagToList (getErrorMessages pst dflags) in
+ let err:_ = bagToList (fmap pprError (getErrorMessages pst)) in
panic $ showSDoc dflags $
text "Hyperlinker parse error:" $$ pprLocErrMsg err
where