X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FInteractiveUI.hs;h=cce48271df44cabb9a5db9dc9606863b5ea04e60;hb=8c99af6a535d6d09b60a5d172980f8364b1c380c;hp=a420ff6472cfe331ac2607e171d54672279f9f20;hpb=13896d87b75817b068f80d873f828b64403e8023;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index a420ff6..cce4827 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.36 2001/02/09 10:08:09 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.60 2001/03/28 16:51:03 simonmar Exp $ -- -- GHC Interactive User Interface -- @@ -7,7 +7,8 @@ -- ----------------------------------------------------------------------------- -module InteractiveUI (interactiveUI) where +{-# OPTIONS -#include "Linker.h" #-} +module InteractiveUI ( interactiveUI, ghciWelcomeMsg ) where #include "HsVersions.h" @@ -17,14 +18,13 @@ import ByteCodeLink import DriverFlags import DriverState import DriverUtil -import Type import Linker -import Finder -import Module -import Outputable import Util -import PprType {- instance Outputable Type; do not delete -} +import Name ( Name ) +import Outputable +import CmdLineOpts ( DynFlag(..), dopt_unset ) import Panic ( GhcException(..) ) +import Config import Exception import Dynamic @@ -40,23 +40,28 @@ import CPUTime import Directory import IO import Char -import Monad ( when ) +import Monad ( when ) +import PrelGHC ( unsafeCoerce# ) +import Foreign ( nullPtr ) +import CString ( peekCString ) ----------------------------------------------------------------------------- ghciWelcomeMsg = "\ -\ _____ __ __ ____ _________________________________________________\n\ -\(| || || (| |) GHC Interactive, version 5.00 \n\ -\|| __ ||___|| || () For Haskell 98. \n\ -\|| |) ||---|| || || http://www.haskell.org/ghc \n\ -\|| || || || || (| Bug reports to: glasgow-haskell-bugs@haskell.org \n\ -\(|___|| || || (|__|) \\\\______________________________________________________\n" - -commands :: [(String, String -> GHCi Bool)] -commands = [ +\ ___ ___ _\n\ +\ / _ \\ /\\ /\\/ __(_)\n\ +\ / /_\\// /_/ / / | | GHC Interactive, version " ++ cProjectVersion ++ ", For Haskell 98.\n\ +\/ /_\\\\/ __ / /___| | http://www.haskell.org/ghc/\n\ +\\\____/\\/ /_/\\____/|_| Type :? for help.\n" + +GLOBAL_VAR(commands, builtin_commands, [(String, String -> GHCi Bool)]) + +builtin_commands :: [(String, String -> GHCi Bool)] +builtin_commands = [ ("add", keepGoing addModule), ("cd", keepGoing changeDirectory), + ("def", keepGoing defineMacro), ("help", keepGoing help), ("?", keepGoing help), ("load", keepGoing loadModule), @@ -65,6 +70,7 @@ commands = [ ("set", keepGoing setOptions), ("type", keepGoing typeOfExpr), ("unset", keepGoing unsetOptions), + ("undef", keepGoing undefineMacro), ("quit", quit) ] @@ -76,37 +82,39 @@ shortHelpText = "use :? for help.\n" helpText = "\ \ Commands available from the prompt:\n\ \\ -\ evaluate \n\ -\ :add add a module to the current set\n\ +\ evaluate/run \n\ \ :cd change directory to \n\ +\ :def define a command :\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