X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FInteractiveUI.hs;h=b09690b8642e1ae84e162d7d6ab9d68a5a84d04d;hb=4e408d576d72a5c39214b512fcc12997310f9fe1;hp=d0cfa227f0f91495a7d095c91a149838a67becde;hpb=b854692dda9ac8f290aa761fcc799b3e4915412f;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index d0cfa22..b09690b 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,43 +1,48 @@ +{-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-} ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.97 2001/10/22 16:16:27 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.112 2002/01/28 13:34:10 simonmar Exp $ -- -- GHC Interactive User Interface -- -- (c) The GHC Team 2000 -- ----------------------------------------------------------------------------- - -{-# OPTIONS -#include "Linker.h" #-} -{-# OPTIONS -#include "SchedAPI.h" #-} module InteractiveUI ( interactiveUI, ghciWelcomeMsg ) where #include "../includes/config.h" #include "HsVersions.h" import Packages + import CompManager -import HscTypes ( TyThing(..) ) -import MkIface -import ByteCodeLink +import CmTypes ( Linkable, isObjectLinkable, ModSummary(..) ) +import CmLink ( findModuleLinkable_maybe ) + +import HscTypes ( TyThing(..), showModMsg, InteractiveContext(..) ) +import HsSyn ( TyClDecl(..), ConDecl(..), Sig(..) ) +import MkIface ( ifaceTyThing ) import DriverFlags import DriverState -import DriverUtil +import DriverUtil ( handle, remove_spaces ) import Linker import Finder ( flushPackageCache ) import Util import Id ( isRecordSelector, recordSelectorFieldLabel, - isDataConWrapId, idName ) + isDataConWrapId, isDataConId, idName ) import Class ( className ) import TyCon ( tyConName, tyConClass_maybe, isPrimTyCon ) import FieldLabel ( fieldLabelTyCon ) import SrcLoc ( isGoodSrcLoc ) +import Module ( moduleName ) +import NameEnv ( nameEnvElts ) import Name ( Name, isHomePackageName, nameSrcLoc, nameOccName, NamedThing(..) ) import OccName ( isSymOcc ) import BasicTypes ( defaultFixity ) import Outputable -import CmdLineOpts ( DynFlag(..), getDynFlags, saveDynFlags, restoreDynFlags, dopt_unset ) -import Panic ( GhcException(..) ) +import CmdLineOpts ( DynFlag(..), DynFlags(..), getDynFlags, saveDynFlags, + restoreDynFlags, dopt_unset ) +import Panic ( GhcException(..), showGhcException ) import Config #ifndef mingw32_TARGET_OS @@ -60,7 +65,7 @@ import CPUTime import Directory import IO import Char -import Monad ( when ) +import Monad import PrelGHC ( unsafeCoerce# ) import Foreign ( nullPtr ) @@ -80,6 +85,7 @@ GLOBAL_VAR(commands, builtin_commands, [(String, String -> GHCi Bool)]) builtin_commands :: [(String, String -> GHCi Bool)] builtin_commands = [ ("add", keepGoing addModule), + ("browse", keepGoing browseCmd), ("cd", keepGoing changeDirectory), ("def", keepGoing defineMacro), ("help", keepGoing help), @@ -89,6 +95,7 @@ builtin_commands = [ ("module", keepGoing setContext), ("reload", keepGoing reloadModule), ("set", keepGoing setCmd), + ("show", keepGoing showCmd), ("type", keepGoing typeOfExpr), ("unset", keepGoing unsetOptions), ("undef", keepGoing undefineMacro), @@ -105,6 +112,7 @@ helpText = "\ \\ \ evaluate/run \n\ \ :add ... add module(s) to the current target set\n\ +\ :browse [*] display the names defined by \n\ \ :cd change directory to \n\ \ :def define a command :\n\ \ :help, :? display this list of commands\n\ @@ -112,11 +120,16 @@ helpText = "\ \ :load ... load module(s) and their dependents\n\ \ :module set the context for expression evaluation to \n\ \ :reload reload the current module set\n\ +\\n\ \ :set