module BNFC.Utils.Panic
  ( panic
  , panicPositionNothing
  , panicEmptyIdentifier
  )

 where

import GHC.Stack ( HasCallStack )
import Prelude ( String, error, (++), ($) )

panic :: HasCallStack => String -> a
panic :: String -> a
panic String
s = String -> a
forall a. HasCallStack => String -> a
error (String -> a) -> String -> a
forall a b. (a -> b) -> a -> b
$ String
"bnfc reached an impossible state: "
                String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
s String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\nPlease report this bug"

panicPositionNothing :: HasCallStack => a
panicPositionNothing :: a
panicPositionNothing = String -> a
forall a. HasCallStack => String -> a
panic String
"position cannot be Nothing here"

panicEmptyIdentifier :: HasCallStack => a
panicEmptyIdentifier :: a
panicEmptyIdentifier = String -> a
forall a. HasCallStack => String -> a
panic String
"Identifier cannot be null"