module Data.Text.Prettyprint.Doc.Render.Util.Panic (
panicUncaughtFail,
panicUnpairedPop,
panicSimpleDocTreeConversionFailed,
panicInputNotFullyConsumed,
panicPeekedEmpty,
panicPoppedEmpty,
) where
panicUncaughtFail :: void
panicUncaughtFail = error ("»SFail« must not appear in a rendered »SimpleDocStream«. This is a bug in the layout algorithm! " ++ report)
panicUnpairedPop :: void
panicUnpairedPop = error ("An unpaired style terminator was encountered. This is a bug in the layout algorithm! " ++ report)
panicSimpleDocTreeConversionFailed :: void
panicSimpleDocTreeConversionFailed = error ("Conversion from SimpleDocStream to SimpleDocTree failed! " ++ report)
panicInputNotFullyConsumed :: void
panicInputNotFullyConsumed = error ("Conversion from SimpleDocStream to SimpleDocTree left unconsumed input! " ++ report)
report :: String
report = "Please report this as a bug"
panicPeekedEmpty, panicPoppedEmpty :: void
(panicPeekedEmpty, panicPoppedEmpty) = (mkErr "Peeked", mkErr "Popped")
where
mkErr x = error (x ++ " an empty style stack! Please report this as a bug.")