diff options
author | amsay@amsay.net <unknown> | 2010-06-25 03:26:32 +0000 |
---|---|---|
committer | amsay@amsay.net <unknown> | 2010-06-25 03:26:32 +0000 |
commit | de1a1f9f882cf1a5c81c4a152edc001aafd3f8a3 (patch) | |
tree | e8eb34a23fd46834a5702274ea9abf44f5270409 /ghc/GhciMonad.hs | |
parent | 8582fce6b6a97fcb5842293866e236fc12cf58c3 (diff) | |
download | haskell-de1a1f9f882cf1a5c81c4a152edc001aafd3f8a3.tar.gz |
trac #2362 (full import syntax in ghci)
'import' syntax is seperate from ':module' syntax
Diffstat (limited to 'ghc/GhciMonad.hs')
-rw-r--r-- | ghc/GhciMonad.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs index 94bd9c2576..88c8caa06d 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 :: [(CtxtCmd, [String], [String])], + remembered_ctx :: [Either (CtxtCmd, [String], [String]) String], -- 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 @@ -257,6 +257,10 @@ 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 |