git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Properly handle multiple files
commit117ee03d27c82b4a28b4bf90d7d4ae725eb64684 authorPhil Freeman <paf31@cantab.net> dateMon 21 Oct 2013, 08:47 (13 years ago) parentcb44ac2
1 file changed+4−3
src/Main.hs+4−3
src/Main.hs+4−3
@@ -26,9 +26,10 @@ import qualified Data.Map as M
2626
2727compile :: [FilePath] -> Maybe FilePath -> Maybe FilePath -> IO ()
2828compile inputFiles outputFile externsFile = do
29− input <- fmap concat $ mapM U.readFile inputFiles
30− let ast = runIndentParser 0 parseDeclarations input
31− case ast of
29+ asts <- fmap (fmap concat . sequence) $ flip mapM inputFiles $ \inputFile -> do
30+ text <- U.readFile inputFile
31+ return $ runIndentParser 0 parseDeclarations text
32+ case asts of
3233 Left err -> do
3334 U.print err
3435 exitFailure