mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-16 22:52:50 -06:00
a bit of refactoring
This commit is contained in:
@@ -25,15 +25,15 @@ import GF.System.Catch
|
||||
import Paths_gf(getDataDir)
|
||||
|
||||
import GF.System.Directory
|
||||
import GF.System.Console
|
||||
import GF.Text.Pretty
|
||||
import System.FilePath
|
||||
import System.IO
|
||||
import System.IO.Error(isUserError,ioeGetErrorString)
|
||||
import System.Environment
|
||||
import System.Exit
|
||||
import System.CPUTime
|
||||
--import System.Cmd
|
||||
import Text.Printf
|
||||
--import Control.Applicative(Applicative(..))
|
||||
import Control.Monad(when,liftM,foldM)
|
||||
import Control.Monad.Trans(MonadIO(..))
|
||||
import Control.Monad.State(StateT,lift)
|
||||
@@ -233,6 +233,21 @@ putPointE v opts msg act = do
|
||||
|
||||
return a
|
||||
|
||||
dumpOut opts pass doc
|
||||
| dump opts d = ePutStrLn (render ("\n\n--#" <+> show d $$ doc))
|
||||
| otherwise = return ()
|
||||
where
|
||||
d = (Dump pass)
|
||||
|
||||
warnOut opts warnings
|
||||
| null warnings = return ()
|
||||
| otherwise = do t <- getTermColors
|
||||
ePutStr (blueFg t);ePutStr ws;ePutStrLn (restore t)
|
||||
where
|
||||
ws = if flag optVerbosity opts == Normal
|
||||
then '\n':warnings
|
||||
else warnings
|
||||
|
||||
-- | Because GHC adds the confusing text "user error" for failures caused by
|
||||
-- calls to 'fail'.
|
||||
ioErrorText e = if isUserError e
|
||||
|
||||
Reference in New Issue
Block a user