diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-09-22 19:30:28 +0200 |
---|---|---|
committer | Sylvain Henry <sylvain@haskus.fr> | 2020-09-30 11:02:33 +0200 |
commit | 7b5972402afad755cd45aaad1a96aac509e9d5d2 (patch) | |
tree | b0ca70dfa338722a8eb6a548ac458212c22d15ae | |
parent | a18c3af7f983f3b6d3cd84093c9079031da58468 (diff) |
Adapt to GHC parser changes
-rw-r--r-- | haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 3 |
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 |