From: sof Date: Mon, 26 May 1997 01:01:43 +0000 (+0000) Subject: [project @ 1997-05-26 01:01:43 by sof] X-Git-Tag: Approximately_1000_patches_recorded~581 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=02a0a5e3387e74a444052c5ccb5cd20faaffff8e;p=ghc-hetmet.git [project @ 1997-05-26 01:01:43 by sof] new function: assertPprPanic --- diff --git a/ghc/compiler/utils/Util.lhs b/ghc/compiler/utils/Util.lhs index 734a321..9919fd0 100644 --- a/ghc/compiler/utils/Util.lhs +++ b/ghc/compiler/utils/Util.lhs @@ -87,7 +87,7 @@ module Util ( -- error handling #if defined(COMPILING_GHC) , panic, panic#, pprPanic, pprPanic#, pprError, pprTrace - , assertPanic + , assertPanic, assertPprPanic #endif {- COMPILING_GHC -} ) where @@ -96,6 +96,7 @@ module Util ( CHK_Ubiq() -- debugging consistency check IMPORT_1_3(List(zipWith4)) +import Pretty #else import List(zipWith4) @@ -851,5 +852,12 @@ pprPanic# heading pretty_msg = panic# (heading++(show pretty_msg)) assertPanic :: String -> Int -> a assertPanic file line = panic ("ASSERT failed! file "++file++", line "++show line) +assertPprPanic :: String -> Int -> Doc -> a +assertPprPanic file line msg + = panic (show (sep [hsep[text "ASSERT failed! file", + text file, + text "line", int line], + msg])) + #endif {- COMPILING_GHC -} \end{code}