diff --git a/packages/tabular/src/Happy/Tabular.hs b/packages/tabular/src/Happy/Tabular.hs index ef6d904d..314ec728 100644 --- a/packages/tabular/src/Happy/Tabular.hs +++ b/packages/tabular/src/Happy/Tabular.hs @@ -10,7 +10,7 @@ import Happy.Tabular.Info import Happy.Tabular.Tabular import Data.Array (Array) import System.IO -import System.Exit +import System.Exit (exitWith, ExitCode(..)) import Control.Monad -------- Main entry point (runTabular) -------- @@ -67,11 +67,11 @@ reportConflicts :: Grammar -> Int -> Int -> IO () reportConflicts g sr rr = case expect g of Just n | n == sr && rr == 0 -> return () Just _ | rr > 0 -> - die' $ "The grammar has reduce/reduce conflicts.\n" ++ - "This is not allowed when an expect directive is given\n" + die $ "The grammar has reduce/reduce conflicts.\n" ++ + "This is not allowed when an expect directive is given\n" Just _ -> - die' $ "The grammar has " ++ show sr ++ " shift/reduce conflicts.\n" ++ - "This is different from the number given in the expect directive\n" + die $ "The grammar has " ++ show sr ++ " shift/reduce conflicts.\n" ++ + "This is different from the number given in the expect directive\n" _ -> do if sr /= 0 then hPutStrLn stderr ("shift/reduce conflicts: " ++ show sr) @@ -81,8 +81,8 @@ reportConflicts g sr rr = case expect g of then hPutStrLn stderr ("reduce/reduce conflicts: " ++ show rr) else return () -die' :: String -> IO a -die' s = hPutStr stderr s >> exitWith (ExitFailure 1) +die :: String -> IO a +die s = hPutStr stderr s >> exitWith (ExitFailure 1) writeInfoFile :: [LALR.ItemSetWithGotos]