From f7059f84687a6aac37405c428a97190662de1dac Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Mon, 28 Jun 2021 19:21:17 +0200 Subject: Fix mkParserOpts (#1411) --- haddock-api/src/Haddock/Backends/Hoogle.hs | 1 - haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'haddock-api/src/Haddock/Backends') diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index dfb167a3..29c64a2d 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -31,7 +31,6 @@ import GHC import GHC.Driver.Ppr import GHC.Utils.Outputable as Outputable import GHC.Utils.Panic -import GHC.Parser.Annotation (IsUnicodeSyntax(..)) import GHC.Unit.State import Data.Char diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 49e2c66f..4e9099d8 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -13,7 +13,8 @@ import qualified Data.ByteString as BS import GHC.Platform import GHC.Types.SourceText import GHC.Driver.Session -import GHC.Utils.Error ( mkPlainMsgEnvelope, pprLocMsgEnvelope ) +import GHC.Driver.Config.Diagnostic +import GHC.Utils.Error ( pprLocMsgEnvelope ) import GHC.Data.FastString ( mkFastString ) import GHC.Parser.Errors.Ppr () import qualified GHC.Types.Error as E @@ -51,9 +52,8 @@ parse dflags fpath bs = case unP (go False []) initState of buf = stringBufferFromByteString bs start = mkRealSrcLoc (mkFastString fpath) 1 1 arch_os = platformArchOS (targetPlatform dflags) - pflags = mkParserOpts (warningFlags dflags) - (extensionFlags dflags) - (mkPlainMsgEnvelope dflags) + pflags = mkParserOpts (extensionFlags dflags) + (initDiagOpts dflags) (supportedLanguagesAndExtensions arch_os) (safeImportsOn dflags) False -- lex Haddocks as comment tokens -- cgit v1.2.3