X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc%2FGhciMonad.hs;h=52b28efdffc3d60078fa9b0167452deb8a3681c3;hp=fd6349720ee1f6b2e66cc0b48b8d2735cfc2c9ee;hb=5cd39aa33f970ff42e22b1c9c73502e4229dc488;hpb=05fd4e9ddd2fb1d76dc9b8733353105eeea3a3d4 diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs index fd63497..52b28ef 100644 --- a/ghc/GhciMonad.hs +++ b/ghc/GhciMonad.hs @@ -56,7 +56,8 @@ data GHCiState = GHCiState editor :: String, stop :: String, options :: [GHCiOption], - prelude :: GHC.Module, + prelude :: GHC.ModuleName, + line_number :: !Int, -- input line break_ctr :: !Int, breaks :: ![(Int, BreakLocation)], tickarrays :: ModuleEnv TickArray, @@ -77,7 +78,7 @@ data GHCiState = GHCiState ghc_e :: Bool -- True if this is 'ghc -e' (or runghc) } -data CtxtCmd -- In each case, the first [String] are the starred modules +data CtxtCmd -- In each case, the first [String] are the starred modules -- and the second are the unstarred ones = SetContext [String] [String] | AddModules [String] [String] @@ -90,6 +91,7 @@ data GHCiOption = ShowTiming -- show time/allocs after evaluation | ShowType -- show the type of expressions | RevertCAFs -- revert CAFs after every evaluation + | Multiline -- use multiline commands deriving Eq data BreakLocation @@ -208,7 +210,7 @@ instance ExceptionMonad (InputT GHCi) where gunblock = Haskeline.unblock -- for convenience... -getPrelude :: GHCi Module +getPrelude :: GHCi ModuleName getPrelude = getGHCiState >>= return . prelude getDynFlags :: GhcMonad m => m DynFlags @@ -253,7 +255,7 @@ runStmt expr step = do reflectGHCi x $ do GHC.handleSourceError (\e -> do GHC.printException e return GHC.RunFailed) $ do - GHC.runStmt expr step + GHC.runStmtWithLocation (progname st) (line_number st) expr step resume :: (SrcSpan -> Bool) -> GHC.SingleStep -> GHCi GHC.RunResult resume canLogSpan step = do