Skip to content

Commit

Permalink
Rename die' to die
Browse files Browse the repository at this point in the history
  • Loading branch information
knothed authored and Ericson2314 committed Oct 1, 2021
1 parent d6a166d commit f429e56
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/tabular/src/Happy/Tabular.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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) --------
Expand Down Expand Up @@ -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)
Expand All @@ -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]
Expand Down

0 comments on commit f429e56

Please sign in to comment.