forked from GitHub/gf-core
preserve error message in batch compile
This commit is contained in:
@@ -32,9 +32,11 @@ import System.Directory
|
|||||||
|
|
||||||
batchCompile :: Options -> [FilePath] -> IO SourceGrammar
|
batchCompile :: Options -> [FilePath] -> IO SourceGrammar
|
||||||
batchCompile opts files = do
|
batchCompile opts files = do
|
||||||
let defOpts = addOptions opts (options [emitCode])
|
let defOpts = addOptions opts (options [emitCode])
|
||||||
Ok (_,gr) <- appIOE $ foldM (compileModule defOpts) emptyCompileEnv files
|
egr <- appIOE $ foldM (compileModule defOpts) emptyCompileEnv files
|
||||||
return gr
|
case egr of
|
||||||
|
Ok (_,gr) -> return gr
|
||||||
|
Bad s -> error s
|
||||||
|
|
||||||
-- to output an intermediate stage
|
-- to output an intermediate stage
|
||||||
intermOut :: Options -> Option -> String -> IOE ()
|
intermOut :: Options -> Option -> String -> IOE ()
|
||||||
|
|||||||
Reference in New Issue
Block a user