diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-09-10 18:20:45 +0200 |
---|---|---|
committer | Sylvain Henry <sylvain@haskus.fr> | 2020-09-29 17:24:03 +0200 |
commit | 8e3f00dd24936b6674d0a2322f8410125968583e (patch) | |
tree | d9630cc481aff867c16300b049b28e8cdd1a7aa2 /ghc/GHCi/UI.hs | |
parent | 4365d77a0b306ada61654c3648b844cfa0f4fdcf (diff) | |
download | haskell-8e3f00dd24936b6674d0a2322f8410125968583e.tar.gz |
Make the parser module less dependent on DynFlags
Bump haddock submodule
Diffstat (limited to 'ghc/GHCi/UI.hs')
-rw-r--r-- | ghc/GHCi/UI.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 6112428d22..029b39ba42 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -50,6 +50,7 @@ import GHC.Driver.Ppr hiding (printForUser) import GHC.Utils.Error hiding (traceCmd) import GHC.Driver.Finder as Finder import GHC.Driver.Monad ( modifySession ) +import GHC.Driver.Config import qualified GHC import GHC ( LoadHowMuch(..), Target(..), TargetId(..), InteractiveImport(..), TyThing(..), Phase, BreakIndex, Resume, SingleStep, Ghc, @@ -1133,7 +1134,7 @@ checkInputForLayout stmt getStmt = do st0 <- getGHCiState let buf' = stringToStringBuffer stmt loc = mkRealSrcLoc (fsLit (progname st0)) (line_number st0) 1 - pstate = Lexer.mkPState dflags buf' loc + pstate = Lexer.initParserState (initParserOpts dflags) buf' loc case Lexer.unP goToEnd pstate of (Lexer.POk _ False) -> return $ Just stmt _other -> do @@ -1175,7 +1176,7 @@ enqueueCommands cmds = do -- The return value True indicates success, as in `runOneCommand`. runStmt :: GhciMonad m => String -> SingleStep -> m (Maybe GHC.ExecResult) runStmt input step = do - pflags <- Lexer.mkParserFlags <$> GHC.getInteractiveDynFlags + pflags <- initParserOpts <$> GHC.getInteractiveDynFlags -- In GHCi, we disable `-fdefer-type-errors`, as well as `-fdefer-type-holes` -- and `-fdefer-out-of-scope-variables` for **naked expressions**. The -- declarations and statements are not affected. |