module BNFC.Utils.Panic ( panic , panicPositionNothing , panicEmptyIdentifier ) where import GHC.Stack ( HasCallStack ) import Prelude ( String, error, (++), ($) ) panic :: HasCallStack => String -> a panic s = error $ "bnfc reached an impossible state: " ++ s ++ "\nPlease report this bug" panicPositionNothing :: HasCallStack => a panicPositionNothing = panic "position cannot be Nothing here" panicEmptyIdentifier :: HasCallStack => a panicEmptyIdentifier = panic "Identifier cannot be null"