Skip to content

Commit 3687faa

Browse files
fixes purescript#851: terminate parser errors with a newline
1 parent 00086aa commit 3687faa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

psc-docs/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Options.Applicative
2828
import qualified Language.PureScript as P
2929
import qualified Paths_purescript as Paths
3030
import System.Exit (exitSuccess, exitFailure)
31-
import System.IO (hPutStr, stderr)
31+
import System.IO (hPutStrLn, stderr)
3232

3333

3434
data PSCDocsOptions = PSCDocsOptions
@@ -42,7 +42,7 @@ docgen (PSCDocsOptions showHierarchy input) = do
4242
e <- P.parseModulesFromFiles (fromMaybe "") <$> mapM (fmap (first Just) . parseFile) (nub input)
4343
case e of
4444
Left err -> do
45-
hPutStr stderr $ show err
45+
hPutStrLn stderr $ show err
4646
exitFailure
4747
Right ms -> do
4848
putStrLn . runDocs $ (renderModules showHierarchy) (map snd ms)

psc/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import Options.Applicative as Opts
2626
import System.Directory (createDirectoryIfMissing)
2727
import System.FilePath (takeDirectory)
2828
import System.Exit (exitSuccess, exitFailure)
29-
import System.IO (hPutStr, hPutStrLn, stderr)
29+
import System.IO (hPutStrLn, stderr)
3030

3131
import qualified Language.PureScript as P
3232
import qualified Paths_purescript as Paths
@@ -58,7 +58,7 @@ compile (PSCOptions input opts stdin output externs usePrefix) = do
5858
modules <- P.parseModulesFromFiles (fromMaybe "") <$> readInput (InputOptions (P.optionsNoPrelude opts) stdin input)
5959
case modules of
6060
Left err -> do
61-
hPutStr stderr $ show err
61+
hPutStrLn stderr $ show err
6262
exitFailure
6363
Right ms -> do
6464
case P.compile opts (map snd ms) prefix of

0 commit comments

Comments
 (0)