From 60d8f688a0c66759bdb7645c9dd4c232bc433c9f Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 15 Aug 2022 12:11:10 +0100 Subject: Unify error reporting --- src/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Main.hs') 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 -- cgit v1.2.3