X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FInteractiveUI.hs;h=d2a96fcd2e4a99afd9168a2a3ec8bb53e67fbc2c;hb=8008273439be481134e43f48e1c252f3b7a8c550;hp=11d41c7ab576980f5de4487a9ee0e8405cd18bb5;hpb=92cdc09e48d3410182581f5bd687d1ee7cbe476b;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index 11d41c7..d2a96fc 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,13 +1,17 @@ {-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-} ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.109 2002/01/23 16:50:49 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.123 2002/05/01 15:48:48 simonmar Exp $ -- -- GHC Interactive User Interface -- -- (c) The GHC Team 2000 -- ----------------------------------------------------------------------------- -module InteractiveUI ( interactiveUI, ghciWelcomeMsg ) where +module InteractiveUI ( + interactiveUI, -- :: CmState -> [FilePath] -> [LibrarySpec] -> IO () + LibrarySpec(..), + ghciWelcomeMsg + ) where #include "../includes/config.h" #include "HsVersions.h" @@ -19,6 +23,7 @@ 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 @@ -27,9 +32,9 @@ 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 TyCon ( tyConName, tyConClass_maybe, isPrimTyCon, DataConDetails(..) ) import FieldLabel ( fieldLabelTyCon ) import SrcLoc ( isGoodSrcLoc ) import Module ( moduleName ) @@ -39,7 +44,7 @@ import Name ( Name, isHomePackageName, nameSrcLoc, nameOccName, import OccName ( isSymOcc ) import BasicTypes ( defaultFixity ) import Outputable -import CmdLineOpts ( DynFlag(..), getDynFlags, saveDynFlags, +import CmdLineOpts ( DynFlag(..), DynFlags(..), getDynFlags, saveDynFlags, restoreDynFlags, dopt_unset ) import Panic ( GhcException(..), showGhcException ) import Config @@ -66,9 +71,10 @@ import IO import Char import Monad -import PrelGHC ( unsafeCoerce# ) +import GlaExts ( unsafeCoerce# ) + import Foreign ( nullPtr ) -import CString ( peekCString ) +import CString ( CString, peekCString, withCString ) ----------------------------------------------------------------------------- @@ -84,6 +90,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), @@ -105,34 +112,36 @@ keepGoing a str = a str >> return False shortHelpText = "use :? for help.\n" +-- NOTE: spaces at the end of each line to workaround CPP/string gap bug. helpText = "\ \ Commands available from the prompt:\n\ -\\ -\ evaluate/run \n\ -\ :add ... add module(s) to the current target set\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\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