X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FInteractiveUI.hs;h=bb842292ca1720f9c51a70a7105eeb2ac3786b15;hb=4db852d22cffb9ae4b99f935c659100c27de53e8;hp=f75c6726eb1c369f66933f26d49562450e6e01b0;hpb=dd6f34b632c29306e56b6bdf232316af26800a4f;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index f75c672..bb84229 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,38 +1,48 @@ +{-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-} ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.86 2001/08/15 14:40:24 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.111 2002/01/28 12:01:12 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 ( GhciMode(..), TyThing(..) ) -import MkIface ( ifaceTyCls ) -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 ( isDataConWrapId, idName ) +import Id ( isRecordSelector, recordSelectorFieldLabel, + isDataConWrapId, isDataConId, idName ) import Class ( className ) -import TyCon ( tyConName ) +import TyCon ( tyConName, tyConClass_maybe, isPrimTyCon ) +import FieldLabel ( fieldLabelTyCon ) import SrcLoc ( isGoodSrcLoc ) -import Name ( Name, isHomePackageName, nameSrcLoc ) +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 @@ -44,7 +54,9 @@ import Dynamic #if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS import Readline #endif +import Concurrent import IOExts +import SystemExts import Numeric import List @@ -53,7 +65,7 @@ import CPUTime import Directory import IO import Char -import Monad ( when ) +import Monad import PrelGHC ( unsafeCoerce# ) import Foreign ( nullPtr ) @@ -73,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), @@ -81,7 +94,8 @@ builtin_commands = [ ("load", keepGoing loadModule), ("module", keepGoing setContext), ("reload", keepGoing reloadModule), - ("set", keepGoing setOptions), + ("set", keepGoing setCmd), + ("show", keepGoing showCmd), ("type", keepGoing typeOfExpr), ("unset", keepGoing unsetOptions), ("undef", keepGoing undefineMacro), @@ -98,17 +112,24 @@ 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\ -\ :info [ ...] display information about the given names, or\n\ -\ about currently loaded files if no names given\n\ +\ :info [ ...] display information about the given names\n\ \ :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