From 7b5972402afad755cd45aaad1a96aac509e9d5d2 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Tue, 22 Sep 2020 19:30:28 +0200 Subject: Adapt to GHC parser changes --- haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'haddock-api/src/Haddock/Backends') 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 -- cgit v1.2.3