diff options
author | Simon Marlow <marlowsd@gmail.com> | 2010-07-05 10:45:57 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2010-07-05 10:45:57 +0000 |
commit | 0f84e2ce427b68295d057cb1ce2cab8f8d12742d (patch) | |
tree | 4c08ac55c0a7fa48067da4591a182dd8a956734c /ghc/GhciMonad.hs | |
parent | 062aa8af7b8545386514ecc9359c485f34e7c0c7 (diff) | |
download | haskell-0f84e2ce427b68295d057cb1ce2cab8f8d12742d.tar.gz |
refactor import declaration support (#2362)
Diffstat (limited to 'ghc/GhciMonad.hs')
-rw-r--r-- | ghc/GhciMonad.hs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs index 88c8caa06d..f1859d7d07 100644 --- a/ghc/GhciMonad.hs +++ b/ghc/GhciMonad.hs @@ -69,7 +69,7 @@ data GHCiState = GHCiState -- remember is here: last_command :: Maybe Command, cmdqueue :: [String], - remembered_ctx :: [Either (CtxtCmd, [String], [String]) String], + remembered_ctx :: [CtxtCmd], -- we remember the :module commands between :loads, so that -- on a :reload we can replay them. See bugs #2049, -- \#1873, #1360. Previously we tried to remember modules that @@ -80,9 +80,10 @@ data GHCiState = GHCiState } data CtxtCmd - = SetContext - | AddModules - | RemModules + = SetContext [String] [String] + | AddModules [String] [String] + | RemModules [String] [String] + | Import String type TickArray = Array Int [(BreakIndex,SrcSpan)] @@ -257,10 +258,6 @@ runStmt expr step = do return GHC.RunFailed) $ do GHC.runStmt expr step -parseImportDecl :: GhcMonad m => String -> m (Maybe (GHC.ImportDecl GHC.RdrName)) -parseImportDecl expr - = GHC.handleSourceError (\e -> GHC.printExceptionAndWarnings e >> return Nothing) (Monad.liftM Just (GHC.parseImportDecl expr)) - resume :: (SrcSpan -> Bool) -> GHC.SingleStep -> GHCi GHC.RunResult resume canLogSpan step = do st <- getGHCiState |