Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions kore/app/exec/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import qualified Data.Text as Text
, split
)
import qualified Data.Text.IO as Text
( putStrLn
( hPutStrLn
, readFile
)
import qualified GHC.Generics as GHC
Expand Down Expand Up @@ -80,6 +80,7 @@ import System.FilePath
)
import System.IO
( IOMode (WriteMode)
, stderr
, withFile
)

Expand Down Expand Up @@ -804,7 +805,7 @@ koreMerge execOptions mergeOptions = do
Nothing -> mergeAllRules mainModule ruleIds
case eitherMergedRule of
(Left err) -> do
lift $ Text.putStrLn err
lift $ Text.hPutStrLn stderr err
return (ExitFailure 1)
(Right mergedRule) -> do
let mergedRule' =
Expand Down
8 changes: 6 additions & 2 deletions kore/app/repl/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ import System.Clock
)

import GlobalMain
import System.IO
( hPutStrLn
, stderr
)

-- | Represents a file name along with its module name passed.
data KoreModule = KoreModule
Expand Down Expand Up @@ -213,7 +217,7 @@ mainWithOptions
&& isNothing (unReplScript replScript)
)
$ lift $ do
putStrLn
hPutStrLn stderr
"You must supply the path to the repl script\
\ in order to run the repl in run-script mode."
exitFailure
Expand All @@ -223,7 +227,7 @@ mainWithOptions
&& scriptModeOutput == EnableOutput
)
$ lift $ do
putStrLn
hPutStrLn stderr
"The --save-run-output flag is only available\
\ when running the repl in run-script mode."
exitFailure
Expand Down
2 changes: 1 addition & 1 deletion kore/src/Kore/BugReport.hs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ withBugReport exeName bugReportOption act =
optionalWriteBugReport tmpDir
| Just (ioe :: IOException) <- fromException someException
, NoSuchThing <- ioe_type ioe -> do
putStrLn $ displayException someException
hPutStrLn stderr $ displayException someException
optionalWriteBugReport tmpDir
| otherwise -> do
let message = displayException someException
Expand Down
4 changes: 3 additions & 1 deletion kore/src/Kore/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ import Kore.Attribute.RuleIndex
import qualified Kore.Attribute.RuleIndex as Attribute
import System.IO
( hFlush
, hPutStrLn
, stderr
, stdout
)
import Text.Megaparsec
Expand Down Expand Up @@ -274,7 +276,7 @@ runRepl
catchInterruptWithDefault a =
Exception.handle $ \case
UserInterrupt -> do
liftIO $ putStrLn "Step evaluation interrupted."
liftIO $ hPutStrLn stderr "Step evaluation interrupted."
pure a
e -> Exception.throwM e

Expand Down
10 changes: 6 additions & 4 deletions kore/src/Kore/Repl/Interpreter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ import System.FilePath
)
import System.IO
( IOMode (..)
, hPutStrLn
, stderr
, withFile
)
import System.Process
Expand Down Expand Up @@ -1191,7 +1193,7 @@ pipe cmd file args = do
outputFunc str
case maybeOutput of
Nothing ->
putStrLn "Error: couldn't access output handle."
hPutStrLn stderr "Error: couldn't access output handle."
Just handle -> do
output <- liftIO $ hGetContents handle
modifyIORef pipeOut (appReplOut . AuxOut $ output)
Expand Down Expand Up @@ -1517,11 +1519,11 @@ parseEvalScript file scriptModeOutput = do
contents <- lift . liftIO $ readFile file
let result = runParser scriptParser file (Text.pack contents)
either parseFailed executeScript result
else lift . liftIO . putStrLn $ "Cannot find " <> file
else lift . liftIO . hPutStrLn stderr $ "Cannot find " <> file

where
parseFailed err =
lift . liftIO . putStrLn
lift . liftIO . hPutStrLn stderr
$ "\nCouldn't parse repl script file."
<> "\nParser error at: "
<> (err & toReplScriptParseErrors & errorBundlePretty)
Expand Down Expand Up @@ -1619,4 +1621,4 @@ withExistingDirectory path action =
ifM
(doesParentDirectoryExist path)
(action path)
$ liftIO . putStrLn $ "Directory does not exist."
$ liftIO . hPutStrLn stderr $ "Directory does not exist."