Skip to content
Snippets Groups Projects
Commit e7a80ef9 authored by sof's avatar sof
Browse files

[project @ 1999-03-24 18:19:08 by sof]

tidied up the error handling defs.
parent 1dd8aff2
No related branches found
No related tags found
No related merge requests found
...@@ -340,8 +340,6 @@ pprQuotedList xs = hsep (punctuate comma (map (quotes . ppr) xs)) ...@@ -340,8 +340,6 @@ pprQuotedList xs = hsep (punctuate comma (map (quotes . ppr) xs))
\end{code} \end{code}
%************************************************************************ %************************************************************************
%* * %* *
\subsection{Printing numbers verbally} \subsection{Printing numbers verbally}
...@@ -386,22 +384,21 @@ speakNTimes t | t == 1 = ptext SLIT("once") ...@@ -386,22 +384,21 @@ speakNTimes t | t == 1 = ptext SLIT("once")
\begin{code} \begin{code}
pprPanic :: String -> SDoc -> a pprPanic :: String -> SDoc -> a
pprPanic heading pretty_msg = panic (show (doc PprDebug))
where
doc = text heading <+> pretty_msg
pprError :: String -> SDoc -> a pprError :: String -> SDoc -> a
pprError heading pretty_msg = error (heading++ " " ++ (showSDoc pretty_msg))
pprTrace :: String -> SDoc -> a -> a pprTrace :: String -> SDoc -> a -> a
pprTrace heading pretty_msg = trace (show (doc PprDebug)) pprPanic = pprAndThen panic
where pprError = pprAndThen error
doc = text heading <+> pretty_msg pprTrace = pprAndThen trace
pprPanic# heading pretty_msg = panic# (show (doc PprDebug)) pprPanic# heading pretty_msg = panic# (show (doc PprDebug))
where where
doc = text heading <+> pretty_msg doc = text heading <+> pretty_msg
pprAndThen :: (String -> a) -> String -> SDoc -> a
pprAndThen cont heading pretty_msg = cont (show (doc PprDebug))
where
doc = text heading <+> pretty_msg
assertPprPanic :: String -> Int -> SDoc -> a assertPprPanic :: String -> Int -> SDoc -> a
assertPprPanic file line msg assertPprPanic file line msg
= panic (show (doc PprDebug)) = panic (show (doc PprDebug))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment