X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;h=e0c49ceed6928e3489e84d667370306085d995cb;hb=831a35dd00faff195cf938659c2dd736192b865f;hp=12a1713dde4e8ce768e7741f48cd86eebb6680a9;hpb=47b550ecf0edcada00034925830a52603f3a87df;p=ghc-hetmet.git diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 12a1713..e0c49ce 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -335,7 +335,7 @@ interactiveUI srcs maybe_exprs = withTerminalReset $ do #endif -- initial context is just the Prelude - prel_mod <- GHC.findModule (GHC.mkModuleName "Prelude") Nothing + prel_mod <- GHC.lookupModule (GHC.mkModuleName "Prelude") Nothing GHC.setContext [] [prel_mod] default_editor <- liftIO $ findEditor @@ -742,7 +742,7 @@ afterRunStmt step_here run_result = do st <- getGHCiState enqueueCommands [stop st] return () - | otherwise -> resume GHC.SingleStep >>= + | otherwise -> resume step_here GHC.SingleStep >>= afterRunStmt step_here >> return () _ -> return () @@ -1215,14 +1215,20 @@ typeOfExpr str ty <- GHC.exprType str dflags <- getDynFlags let pefas = dopt Opt_PrintExplicitForalls dflags - printForUser $ sep [text str, nest 2 (dcolon <+> pprTypeForUser pefas ty)] + printForUser $ sep [utext str, nest 2 (dcolon <+> pprTypeForUser pefas ty)] kindOfType :: String -> GHCi () kindOfType str = handleSourceError (\e -> GHC.printExceptionAndWarnings e) $ do ty <- GHC.typeKind str - printForUser $ text str <+> dcolon <+> ppr ty + printForUser $ utext str <+> dcolon <+> ppr ty +-- HACK for printing unicode text. We assume the output device +-- understands UTF-8, and go via FastString which converts to UTF-8. +-- ToDo: fix properly when we have encoding support in Handles. +utext :: String -> SDoc +utext str = ftext (mkFastString str) + quit :: String -> GHCi Bool quit _ = return True @@ -1978,7 +1984,7 @@ continueCmd = noArgs $ doContinue (const True) GHC.RunToCompletion -- doContinue :: SingleStep -> GHCi () doContinue :: (SrcSpan -> Bool) -> SingleStep -> GHCi () doContinue pred step = do - runResult <- resume step + runResult <- resume pred step afterRunStmt pred runResult return () @@ -2350,7 +2356,7 @@ mkTickArray ticks lookupModule :: String -> GHCi Module lookupModule modName - = GHC.findModule (GHC.mkModuleName modName) Nothing + = GHC.lookupModule (GHC.mkModuleName modName) Nothing -- don't reset the counter back to zero? discardActiveBreakPoints :: GHCi ()