summaryrefslogtreecommitdiff
path: root/ghc/GhciMonad.hs
diff options
context:
space:
mode:
authorVivian McPhail <haskell.vivian.mcphail@gmail.com>2011-02-26 07:31:33 +0000
committerVivian McPhail <haskell.vivian.mcphail@gmail.com>2011-02-26 07:31:33 +0000
commiteccb2d89eb4b34f31e8ea337d5f8673605f71665 (patch)
treedbf1de76ef655523c9e7daa818a570692bc6019e /ghc/GhciMonad.hs
parent74430537272aecdc8fd85b4877cec76cc042c8ad (diff)
downloadhaskell-eccb2d89eb4b34f31e8ea337d5f8673605f71665.tar.gz
:script file scripts in GHCi #1363
This patch adds the script command in GHCi A file is read and executed as a series of GHCi commands. Execution terminates on the first error. The filename and line number are included in the error.
Diffstat (limited to 'ghc/GhciMonad.hs')
-rw-r--r--ghc/GhciMonad.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs
index 779fad23e9..2aff48385e 100644
--- a/ghc/GhciMonad.hs
+++ b/ghc/GhciMonad.hs
@@ -57,6 +57,7 @@ data GHCiState = GHCiState
stop :: String,
options :: [GHCiOption],
prelude :: GHC.Module,
+ line_number :: !Int, -- input line
break_ctr :: !Int,
breaks :: ![(Int, BreakLocation)],
tickarrays :: ModuleEnv TickArray,
@@ -254,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