Commit 55250a63 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Rename GHCi's UI modules into GHCi.UI(.*)

Further work refactoring and enhancing GHCi will make it desirable to
split up GHCi's code-base into multiple modules with specific functions,
and rather than have several top-level 'Ghci*' modules, it's nicer to
have a common namespace. This commit is provides the basis for that.

Note that the remaining GHCi.* namespace belongs to the new `ghci`
package.

Differential Revision: https://phabricator.haskell.org/D1593
parent eeecb864
......@@ -20,7 +20,7 @@
--
-----------------------------------------------------------------------------
module InteractiveUI (
module GHCi.UI (
interactiveUI,
GhciSettings(..),
defaultGhciSettings,
......@@ -31,10 +31,10 @@ module InteractiveUI (
#include "HsVersions.h"
-- GHCi
import qualified GhciMonad ( args, runStmt )
import GhciMonad hiding ( args, runStmt )
import GhciTags
import GhciInfo
import qualified GHCi.UI.Monad as GhciMonad ( args, runStmt, runDecls )
import GHCi.UI.Monad hiding ( args, runStmt, runDecls )
import GHCi.UI.Tags
import GHCi.UI.Info
import Debugger
-- The GHC interface
......@@ -434,7 +434,7 @@ interactiveUI config srcs maybe_exprs = do
eval_wrapper <- mkEvalWrapper default_progname default_args
startGHCi (runGHCi srcs maybe_exprs)
GHCiState{ progname = default_progname,
GhciMonad.args = default_args,
args = default_args,
evalWrapper = eval_wrapper,
prompt = defPrompt config,
prompt2 = defPrompt2 config,
......
......@@ -4,7 +4,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
-- | Get information on modules, expreesions, and identifiers
module GhciInfo
module GHCi.UI.Info
( ModInfo(..)
, SpanInfo(..)
, spanInfoFromRealSrcSpan
......
......@@ -10,7 +10,7 @@
--
-----------------------------------------------------------------------------
module GhciMonad (
module GHCi.UI.Monad (
GHCi(..), startGHCi,
GHCiState(..), setGHCiState, getGHCiState, modifyGHCiState,
GHCiOption(..), isOptionSet, setOption, unsetOption,
......@@ -31,7 +31,7 @@ module GhciMonad (
#include "HsVersions.h"
import GhciInfo (ModInfo)
import GHCi.UI.Info (ModInfo)
import qualified GHC
import GhcMonad hiding (liftIO)
import Outputable hiding (printForUser, printForUserPartWay)
......
......@@ -7,7 +7,7 @@
-----------------------------------------------------------------------------
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
module GhciTags (
module GHCi.UI.Tags (
createCTagsWithLineNumbersCmd,
createCTagsWithRegExesCmd,
createETagsFileCmd
......@@ -15,7 +15,7 @@ module GhciTags (
import Exception
import GHC
import GhciMonad
import GHCi.UI.Monad
import Outputable
-- ToDo: figure out whether we need these, and put something appropriate
......@@ -61,7 +61,7 @@ ghciCreateTagsFile :: TagsKind -> FilePath -> GHCi ()
ghciCreateTagsFile kind file = do
createTagsFile kind file
-- ToDo:
-- ToDo:
-- - remove restriction that all modules must be interpreted
-- (problem: we don't know source locations for entities unless
-- we compiled the module.
......@@ -213,4 +213,3 @@ showETag TagInfo{ tagName = tag, tagLine = lineNo, tagCol = colNo,
++ "\x01" ++ show lineNo
++ "," ++ show charPos
showETag _ = throwGhcException (CmdLineError "missing source file info in showETag")
......@@ -25,7 +25,7 @@ import HscMain ( newHscEnv )
import DriverPipeline ( oneShot, compileFile )
import DriverMkDepend ( doMkDependHS )
#ifdef GHCI
import InteractiveUI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings )
import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings )
#endif
-- Frontend plugins
......
......@@ -56,10 +56,10 @@ Executable ghc
CPP-Options: -DGHCI
GHC-Options: -fno-warn-name-shadowing
Other-Modules:
GhciInfo
GhciMonad
GhciTags
InteractiveUI
GHCi.UI
GHCi.UI.Info
GHCi.UI.Monad
GHCi.UI.Tags
Other-Extensions:
BangPatterns
FlexibleInstances
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment