git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Use stderr for docgen errors.
c3d7cb5joneshf
docgen/Main.hs+3−2
@@ -25,6 +25,7 @@ import qualified Paths_purescript as Paths
25import qualified System.IO.UTF8 as U
25import qualified System.IO.UTF8 as U
26import System.Console.CmdTheLine
26import System.Console.CmdTheLine
27import System.Exit (exitSuccess, exitFailure)
27import System.Exit (exitSuccess, exitFailure)
28+import System.IO (stderr)
28
29
29docgen :: Bool -> [FilePath] -> IO ()
30docgen :: Bool -> [FilePath] -> IO ()
30docgen showHierarchy input = do
31docgen showHierarchy input = do
@@ -37,7 +38,7 @@ parseFile input = do
37 text <- U.readFile input
38 text <- U.readFile input
38 case P.runIndentParser input P.parseModules text of
39 case P.runIndentParser input P.parseModules text of
39 Left err -> do
40 Left err -> do
40− U.print err
41+ U.hPutStr stderr $ show err
41 exitFailure
42 exitFailure
42 Right ms -> do
43 Right ms -> do
43 return ms
44 return ms
@@ -168,7 +169,7 @@ prettyPrintType' :: P.Type -> String
168prettyPrintType' = P.prettyPrintType . P.everywhereOnTypes dePrim
169prettyPrintType' = P.prettyPrintType . P.everywhereOnTypes dePrim
169 where
170 where
170 dePrim ty@(P.TypeConstructor (P.Qualified _ name))
171 dePrim ty@(P.TypeConstructor (P.Qualified _ name))
171− | ty == P.tyBoolean || ty == P.tyNumber || ty == P.tyString =
172+ | ty == P.tyBoolean || ty == P.tyNumber || ty == P.tyString =
172 P.TypeConstructor $ P.Qualified Nothing name
173 P.TypeConstructor $ P.Qualified Nothing name
173 dePrim other = other
174 dePrim other = other
174
175