aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-08-15 12:11:10 +0100
committerJuan J. Martinez <jjm@usebox.net>2022-08-15 12:11:10 +0100
commit60d8f688a0c66759bdb7645c9dd4c232bc433c9f (patch)
treec81394d00bf9825eae6c456ac6238e0f72bbe4ce /src/Main.hs
parentcd4c8a3f1b92f0e6a585bd0b199374b8b99c6238 (diff)
downloadmicro-lang-hs-60d8f688a0c66759bdb7645c9dd4c232bc433c9f.tar.gz
micro-lang-hs-60d8f688a0c66759bdb7645c9dd4c232bc433c9f.zip
Unify error reporting
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 6df7e6c..47fd883 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -3,7 +3,7 @@ module Main where
import Compiler
import Control.Monad.State (evalState)
import qualified Data.Map as Map
-import Error (showErrorList)
+import Error (showErrorList, showParserError)
import Lexer (scan)
import Parser (parse, parseFromFile)
import System.Exit (exitFailure)
@@ -13,7 +13,7 @@ main :: IO ()
main = do
res <- parseFromFile (scan parse) "input"
case res of
- Left err -> hPutStrLn stderr ("error: " ++ show err) >> exitFailure
+ Left err -> hPutStrLn stderr (showParserError err) >> exitFailure
Right ast -> do
res <- return $ evalState (compileAll ast) startState
case res of