mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 18:02:54 -06:00
Some work to improve the structure of the haddock documenation
This commit is contained in:
1
gf.cabal
1
gf.cabal
@@ -141,6 +141,7 @@ Library
|
|||||||
hs-source-dirs: src/compiler
|
hs-source-dirs: src/compiler
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
GF
|
GF
|
||||||
|
GF.Support
|
||||||
GF.Text.Pretty
|
GF.Text.Pretty
|
||||||
|
|
||||||
other-modules:
|
other-modules:
|
||||||
|
|||||||
@@ -16,16 +16,7 @@ module GF(
|
|||||||
module GF.Grammar.Printer,
|
module GF.Grammar.Printer,
|
||||||
module GF.Infra.Ident,
|
module GF.Infra.Ident,
|
||||||
-- ** Binary serialisation
|
-- ** Binary serialisation
|
||||||
module GF.Grammar.Binary,
|
module GF.Grammar.Binary
|
||||||
|
|
||||||
-- * Supporting infrastructure and system utilities
|
|
||||||
module GF.Infra.Location,
|
|
||||||
module GF.Data.Operations,
|
|
||||||
module GF.Infra.UseIO,
|
|
||||||
module GF.Infra.Option,
|
|
||||||
module GF.System.Console,
|
|
||||||
-- ** Binary serialisation
|
|
||||||
Binary,encode,decode,encodeFile,decodeFile
|
|
||||||
) where
|
) where
|
||||||
import GF.Main
|
import GF.Main
|
||||||
import GF.Compiler
|
import GF.Compiler
|
||||||
@@ -41,10 +32,3 @@ import GF.Grammar.Macros
|
|||||||
import GF.Grammar.Printer
|
import GF.Grammar.Printer
|
||||||
import GF.Infra.Ident
|
import GF.Infra.Ident
|
||||||
import GF.Grammar.Binary
|
import GF.Grammar.Binary
|
||||||
|
|
||||||
import GF.Infra.Location
|
|
||||||
import GF.Data.Operations
|
|
||||||
import GF.Infra.Option
|
|
||||||
import GF.Infra.UseIO
|
|
||||||
import GF.System.Console
|
|
||||||
import Data.Binary
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
module GF.Infra.Option
|
module GF.Infra.Option
|
||||||
(
|
(
|
||||||
-- ** Option types
|
-- ** Command line options
|
||||||
|
-- *** Option types
|
||||||
Options,
|
Options,
|
||||||
Flags(..),
|
Flags(..),
|
||||||
Mode(..), Phase(..), Verbosity(..),
|
Mode(..), Phase(..), Verbosity(..),
|
||||||
@@ -8,21 +9,21 @@ module GF.Infra.Option
|
|||||||
SISRFormat(..), Optimization(..), CFGTransform(..), HaskellOption(..),
|
SISRFormat(..), Optimization(..), CFGTransform(..), HaskellOption(..),
|
||||||
Dump(..), Pass(..), Recomp(..),
|
Dump(..), Pass(..), Recomp(..),
|
||||||
outputFormatsExpl,
|
outputFormatsExpl,
|
||||||
-- ** Option parsing
|
-- *** Option parsing
|
||||||
parseOptions, parseModuleOptions, fixRelativeLibPaths,
|
parseOptions, parseModuleOptions, fixRelativeLibPaths,
|
||||||
-- ** Option pretty-printing
|
-- *** Option pretty-printing
|
||||||
optionsGFO,
|
optionsGFO,
|
||||||
optionsPGF,
|
optionsPGF,
|
||||||
-- ** Option manipulation
|
-- *** Option manipulation
|
||||||
addOptions, concatOptions, noOptions,
|
addOptions, concatOptions, noOptions,
|
||||||
modifyFlags,
|
modifyFlags,
|
||||||
helpMessage,
|
helpMessage,
|
||||||
-- ** Checking specific options
|
-- *** Checking specific options
|
||||||
flag, cfgTransform, haskellOption, readOutputFormat,
|
flag, cfgTransform, haskellOption, readOutputFormat,
|
||||||
isLexicalCat, isLiteralCat, renameEncoding, getEncoding, defaultEncoding,
|
isLexicalCat, isLiteralCat, renameEncoding, getEncoding, defaultEncoding,
|
||||||
-- ** Setting specific options
|
-- *** Setting specific options
|
||||||
setOptimization, setCFGTransform,
|
setOptimization, setCFGTransform,
|
||||||
-- ** Convenience methods for checking options
|
-- *** Convenience methods for checking options
|
||||||
verbAtLeast, dump
|
verbAtLeast, dump
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,9 @@
|
|||||||
-- (Description of the module)
|
-- (Description of the module)
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
module GF.Infra.UseIO(module GF.Infra.UseIO,
|
module GF.Infra.UseIO(-- ** Files and IO
|
||||||
-- ** Reused
|
module GF.Infra.UseIO,
|
||||||
|
-- *** Reused
|
||||||
MonadIO(..),liftErr) where
|
MonadIO(..),liftErr) where
|
||||||
|
|
||||||
import Prelude hiding (catch)
|
import Prelude hiding (catch)
|
||||||
@@ -40,7 +41,7 @@ import Control.Exception(evaluate)
|
|||||||
--putIfVerb :: MonadIO io => Options -> String -> io ()
|
--putIfVerb :: MonadIO io => Options -> String -> io ()
|
||||||
putIfVerb opts msg = when (verbAtLeast opts Verbose) $ putStrLnE msg
|
putIfVerb opts msg = when (verbAtLeast opts Verbose) $ putStrLnE msg
|
||||||
|
|
||||||
-- ** GF files path and library path manipulation
|
-- *** GF files path and library path manipulation
|
||||||
|
|
||||||
type FileName = String
|
type FileName = String
|
||||||
type InitPath = String -- ^ the directory portion of a pathname
|
type InitPath = String -- ^ the directory portion of a pathname
|
||||||
@@ -123,7 +124,7 @@ splitInModuleSearchPath s = case break isPathSep s of
|
|||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
-- ** IO monad with error; adapted from state monad
|
-- *** Error handling in the IO monad
|
||||||
|
|
||||||
-- | Was: @newtype IOE a = IOE { appIOE :: IO (Err a) }@
|
-- | Was: @newtype IOE a = IOE { appIOE :: IO (Err a) }@
|
||||||
type IOE a = IO a
|
type IOE a = IO a
|
||||||
@@ -177,7 +178,7 @@ die :: String -> IO a
|
|||||||
die s = do hPutStrLn stderr s
|
die s = do hPutStrLn stderr s
|
||||||
exitFailure
|
exitFailure
|
||||||
|
|
||||||
-- ** Diagnostic output
|
-- *** Diagnostic output
|
||||||
|
|
||||||
class Monad m => Output m where
|
class Monad m => Output m where
|
||||||
ePutStr, ePutStrLn, putStrE, putStrLnE :: String -> m ()
|
ePutStr, ePutStrLn, putStrE, putStrLnE :: String -> m ()
|
||||||
@@ -215,7 +216,7 @@ ioErrorText e = if isUserError e
|
|||||||
then ioeGetErrorString e
|
then ioeGetErrorString e
|
||||||
else show e
|
else show e
|
||||||
|
|
||||||
-- ** Timing
|
-- *** Timing
|
||||||
|
|
||||||
timeIt act =
|
timeIt act =
|
||||||
do t1 <- liftIO $ getCPUTime
|
do t1 <- liftIO $ getCPUTime
|
||||||
@@ -223,7 +224,7 @@ timeIt act =
|
|||||||
t2 <- liftIO $ getCPUTime
|
t2 <- liftIO $ getCPUTime
|
||||||
return (t2-t1,a)
|
return (t2-t1,a)
|
||||||
|
|
||||||
-- ** File IO
|
-- *** File IO
|
||||||
|
|
||||||
writeUTF8File :: FilePath -> String -> IO ()
|
writeUTF8File :: FilePath -> String -> IO ()
|
||||||
writeUTF8File fpath content =
|
writeUTF8File fpath content =
|
||||||
|
|||||||
17
src/compiler/GF/Support.hs
Normal file
17
src/compiler/GF/Support.hs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
module GF.Support(
|
||||||
|
-- * Supporting infrastructure and system utilities
|
||||||
|
module GF.Infra.Location,
|
||||||
|
module GF.Infra.Option,
|
||||||
|
module GF.Data.Operations,
|
||||||
|
module GF.Infra.UseIO,
|
||||||
|
module GF.System.Console,
|
||||||
|
-- ** Binary serialisation
|
||||||
|
Binary,encode,decode,encodeFile,decodeFile
|
||||||
|
) where
|
||||||
|
|
||||||
|
import GF.Infra.Location
|
||||||
|
import GF.Data.Operations
|
||||||
|
import GF.Infra.Option
|
||||||
|
import GF.Infra.UseIO
|
||||||
|
import GF.System.Console
|
||||||
|
import Data.Binary
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
module GF.System.Console(
|
module GF.System.Console(
|
||||||
-- ** Changing which character encoding to use for console IO
|
-- ** Console IO
|
||||||
|
-- *** Changing which character encoding to use for console IO
|
||||||
setConsoleEncoding,changeConsoleEncoding,
|
setConsoleEncoding,changeConsoleEncoding,
|
||||||
-- ** Console colors
|
-- *** Console colors
|
||||||
TermColors(..),getTermColors
|
TermColors(..),getTermColors
|
||||||
) where
|
) where
|
||||||
import System.IO
|
import System.IO
|
||||||
|
|||||||
Reference in New Issue
Block a user