From cdf88f13008cd3f6511d466c1078ae7b2f983faf Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 9 Sep 2022 12:41:03 +0100 Subject: Refactored the compiler result to plug in the code generator Also some tweaks in error reporting. --- app/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/Main.hs b/app/Main.hs index 5a16129..db970d9 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -71,8 +71,8 @@ compileFile filename onlyParse = do Left err -> hPutStrLn stderr (showParserError err) >> exitFailure Right ast -> do res <- return $ evalState (compileAll ast) startState - case res of - Right _ -> if onlyParse then exitSuccess else print ast + case crExit res of + Right out -> if onlyParse then exitSuccess else hPutStrLn stdout out Left errs -> hPutStr stderr (showErrorList errs) >> exitFailure main :: IO () -- cgit v1.2.3