X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FInteractiveUI.hs;h=d1b6b771c52908348c219c257235caf007a34f26;hb=224131a71a9edbd6aa8d5a704f1012f8a0a88814;hp=6416e23a7fe1e426fba8c5768bde737fe42d9434;hpb=3be030c261124cfa5934b6a65e0c9fe097696cd7;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index 6416e23..d1b6b77 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,38 +1,55 @@ +{-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-} ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.41 2001/02/11 14:33:27 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.105 2002/01/03 17:09:15 simonmar Exp $ -- -- GHC Interactive User Interface -- -- (c) The GHC Team 2000 -- ----------------------------------------------------------------------------- +module InteractiveUI ( interactiveUI, ghciWelcomeMsg ) where -module InteractiveUI (interactiveUI) where - +#include "../includes/config.h" #include "HsVersions.h" +import Packages import CompManager -import CmStaticInfo +import HscTypes ( TyThing(..) ) +import MkIface import ByteCodeLink import DriverFlags import DriverState import DriverUtil -import Type import Linker -import Finder -import Module -import Outputable +import Finder ( flushPackageCache ) import Util -import PprType {- instance Outputable Type; do not delete -} -import Panic ( GhcException(..) ) +import Id ( isRecordSelector, recordSelectorFieldLabel, + isDataConWrapId, idName ) +import Class ( className ) +import TyCon ( tyConName, tyConClass_maybe, isPrimTyCon ) +import FieldLabel ( fieldLabelTyCon ) +import SrcLoc ( isGoodSrcLoc ) +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(..), showGhcException ) import Config +#ifndef mingw32_TARGET_OS +import Posix +#endif + import Exception import Dynamic -#ifndef NO_READLINE -import Readline +#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS +import Readline #endif +import Concurrent import IOExts +import SystemExts import Numeric import List @@ -41,16 +58,18 @@ import CPUTime import Directory import IO import Char -import Monad ( when ) +import Monad ( when, join ) import PrelGHC ( unsafeCoerce# ) +import Foreign ( nullPtr ) +import CString ( peekCString ) ----------------------------------------------------------------------------- ghciWelcomeMsg = "\ \ ___ ___ _\n\ \ / _ \\ /\\ /\\/ __(_)\n\ -\ / /_\\// /_/ / / | | GHC Interactive, version " ++ cProjectVersion ++ ", For Haskell 98.\n\ +\ / /_\\// /_/ / / | | GHC Interactive, version " ++ cProjectVersion ++ ", for Haskell 98.\n\ \/ /_\\\\/ __ / /___| | http://www.haskell.org/ghc/\n\ \\\____/\\/ /_/\\____/|_| Type :? for help.\n" @@ -63,10 +82,11 @@ builtin_commands = [ ("def", keepGoing defineMacro), ("help", keepGoing help), ("?", keepGoing help), + ("info", keepGoing info), ("load", keepGoing loadModule), ("module", keepGoing setContext), ("reload", keepGoing reloadModule), - ("set", keepGoing setOptions), + ("set", keepGoing setCmd), ("type", keepGoing typeOfExpr), ("unset", keepGoing unsetOptions), ("undef", keepGoing undefineMacro), @@ -80,111 +100,176 @@ shortHelpText = "use :? for help.\n" helpText = "\ \ Commands available from the prompt:\n\ -\\ -\ evaluate \n\ -\ :add add a module to the current set\n\ -\ :cd change directory to \n\ -\ :help, :? display this list of commands\n\ -\ :load load a module (and it dependents)\n\ -\ :module set the context for expression evaluation to \n\ -\ :reload reload the current module set\n\ -\ :set