Commit aadb6d6d authored by simonmar's avatar simonmar
Browse files

[project @ 2001-02-07 16:47:25 by simonmar]

Add "Warning:" to the front of warning messages.
parent c2f8c96b
......@@ -27,7 +27,7 @@ import Type ( splitAlgTyConApp, mkTyVarTys, Type )
import TysWiredIn ( nilDataCon, consDataCon, mkTupleTy, mkListTy, tupleCon )
import BasicTypes ( Boxity(..) )
import UniqSet
import ErrUtils ( addErrLocHdrLine, dontAddErrLoc )
import ErrUtils ( addWarnLocHdrLine, dontAddErrLoc )
import Outputable
\end{code}
......@@ -113,7 +113,7 @@ pp_context NoMatchContext msg rest_of_msg_fun
pp_context (DsMatchContext kind pats loc) msg rest_of_msg_fun
= case pp_match kind pats of
(ppr_match, pref) ->
addErrLocHdrLine loc message (nest 8 (rest_of_msg_fun pref))
addWarnLocHdrLine loc message (nest 8 (rest_of_msg_fun pref))
where
message = ptext SLIT("Pattern match(es)") <+> msg <+> ppr_match <> char ':'
where
......
......@@ -8,7 +8,7 @@ module ErrUtils (
ErrMsg, WarnMsg, Message, Messages, errorsFound, warningsFound,
addShortErrLocLine, addShortWarnLocLine,
addErrLocHdrLine, dontAddErrLoc,
addErrLocHdrLine, addWarnLocHdrLine, dontAddErrLoc,
printErrorsAndWarnings, pprBagOfErrors, pprBagOfWarnings,
......@@ -37,6 +37,7 @@ type Message = SDoc
addShortErrLocLine :: SrcLoc -> Message -> ErrMsg
addErrLocHdrLine :: SrcLoc -> Message -> Message -> ErrMsg
addWarnLocHdrLine :: SrcLoc -> Message -> Message -> ErrMsg
addShortWarnLocLine :: SrcLoc -> Message -> WarnMsg
addShortErrLocLine locn rest_of_err_msg
......@@ -50,6 +51,12 @@ addErrLocHdrLine locn hdr rest_of_err_msg
4 rest_of_err_msg
)
addWarnLocHdrLine locn hdr rest_of_err_msg
= ( locn
, hang (ppr locn <> colon <+> ptext SLIT("Warning:") <+> hdr)
4 (rest_of_err_msg)
)
addShortWarnLocLine locn rest_of_err_msg
| isGoodSrcLoc locn = (locn, hang (ppr locn <> colon) 4
(ptext SLIT("Warning:") <+> rest_of_err_msg))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment