X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FInteractiveUI.hs;h=dd4343fa40994eac059f86ea5ed3cb68349604e7;hb=effc285ff0be62636148d66bb4bf0002baaf14e8;hp=282ad93f9092d7ed1ab6c0f97a6ed39f82cd4845;hpb=bc882daec931dcde171341f1fee32b45b17cc22e;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index 282ad93..dd4343f 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -15,34 +15,32 @@ module InteractiveUI ( -- The GHC interface import qualified GHC -import GHC ( Session, verbosity, dopt, DynFlag(..), +import GHC ( Session, verbosity, dopt, DynFlag(..), Target(..), + TargetId(..), mkModule, pprModule, Type, Module, SuccessFlag(..), - TyThing(..), Name, LoadHowMuch(..), + TyThing(..), Name, LoadHowMuch(..), Phase, GhcException(..), showGhcException, - CheckedModule(..) ) + CheckedModule(..), SrcLoc ) +import PprTyThing import Outputable --- following all needed for :info... ToDo: remove -import IfaceSyn ( IfaceDecl(..), IfaceClassOp(..), IfaceConDecls(..), - IfaceConDecl(..), IfaceType, - pprIfaceDeclHead, pprParendIfaceType, - pprIfaceForAllPart, pprIfaceType ) -import FunDeps ( pprFundeps ) -import SrcLoc ( SrcLoc, pprDefnLoc ) -import OccName ( OccName, parenSymOcc, occNameUserString ) -import BasicTypes ( StrictnessMark(..), defaultFixity, failed, successIf ) +-- for createtags (should these come via GHC?) +import Module ( moduleString ) +import Name ( nameSrcLoc, nameModule, nameOccName ) +import OccName ( pprOccName ) +import SrcLoc ( isGoodSrcLoc, srcLocFile, srcLocLine, srcLocCol ) -- Other random utilities +import Digraph ( flattenSCCs ) +import BasicTypes ( failed, successIf ) import Panic ( panic, installSignalHandlers ) import Config import StaticFlags ( opt_IgnoreDotGhci ) import Linker ( showLinkerState ) import Util ( removeSpaces, handle, global, toArgs, - looksLikeModuleName, prefixMatch ) -import ErrUtils ( printErrorsAndWarnings ) + looksLikeModuleName, prefixMatch, sortLe ) #ifndef mingw32_HOST_OS -import Util ( handle ) import System.Posix #if __GLASGOW_HASKELL__ > 504 hiding (getEnv) @@ -65,7 +63,7 @@ import Data.Dynamic import Numeric import Data.List import Data.Int ( Int64 ) -import Data.Maybe ( isJust ) +import Data.Maybe ( isJust, fromMaybe, catMaybes ) import System.Cmd import System.CPUTime import System.Environment @@ -106,10 +104,13 @@ builtin_commands = [ ("info", keepGoing info), ("load", keepGoingPaths loadModule_), ("module", keepGoing setContext), + ("main", keepGoing runMain), ("reload", keepGoing reloadModule), ("check", keepGoing checkModule), ("set", keepGoing setCmd), ("show", keepGoing showCmd), + ("etags", keepGoing createETagsFileCmd), + ("ctags", keepGoing createCTagsFileCmd), ("type", keepGoing typeOfExpr), ("kind", keepGoing kindOfType), ("unset", keepGoing unsetOptions), @@ -138,6 +139,7 @@ helpText = " :info [ ...] display information about the given names\n" ++ " :load ... load module(s) and their dependents\n" ++ " :module [+/-] [*] ... set the context for expression evaluation\n" ++ + " :main [ ...] run the main function with the given arguments\n" ++ " :reload reload the current module set\n" ++ "\n" ++ " :set