summaryrefslogtreecommitdiff
path: root/compiler/GHC/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Utils')
-rw-r--r--compiler/GHC/Utils/Error.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/GHC/Utils/Error.hs b/compiler/GHC/Utils/Error.hs
index 05d98c9ed8..ed33c35551 100644
--- a/compiler/GHC/Utils/Error.hs
+++ b/compiler/GHC/Utils/Error.hs
@@ -14,21 +14,21 @@ module GHC.Utils.Error (
Severity(..),
-- * Messages
- ErrMsg(..),
WarnMsg,
+ MsgEnvelope(..),
SDoc,
Messages, ErrorMessages, WarningMessages,
unionMessages,
errorsFound, isEmptyMessages,
-- ** Formatting
- pprMessageBag, pprErrMsgBagWithLoc,
- pprLocErrMsg,
+ pprMessageBag, pprMsgEnvelopeBagWithLoc,
+ pprLocMsgEnvelope,
formatErrDoc,
-- ** Construction
emptyMessages, mkLocMessage, mkLocMessageAnn, makeIntoWarning,
- mkErrMsg, mkPlainErrMsg, mkErr, mkLongErrMsg, mkWarnMsg,
+ mkMsgEnvelope, mkPlainMsgEnvelope, mkErr, mkLongMsgEnvelope, mkWarnMsg,
mkPlainWarnMsg,
mkLongWarnMsg,
@@ -130,18 +130,18 @@ formatErrDoc ctx docs
msgs = filter (not . Outputable.isEmpty ctx) docs
starred = (bullet<+>)
-pprErrMsgBagWithLoc :: Bag (ErrMsg [SDoc]) -> [SDoc]
-pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag Nothing bag ]
+pprMsgEnvelopeBagWithLoc :: Bag (MsgEnvelope [SDoc]) -> [SDoc]
+pprMsgEnvelopeBagWithLoc bag = [ pprLocMsgEnvelope item | item <- sortMsgBag Nothing bag ]
-pprLocErrMsg :: RenderableDiagnostic e => ErrMsg e -> SDoc
-pprLocErrMsg (ErrMsg { errMsgSpan = s
- , errMsgDiagnostic = e
- , errMsgSeverity = sev
- , errMsgContext = unqual })
+pprLocMsgEnvelope :: RenderableDiagnostic e => MsgEnvelope e -> SDoc
+pprLocMsgEnvelope (MsgEnvelope { errMsgSpan = s
+ , errMsgDiagnostic = e
+ , errMsgSeverity = sev
+ , errMsgContext = unqual })
= sdocWithContext $ \ctx ->
withErrStyle unqual $ mkLocMessage sev s (formatErrDoc ctx $ renderDiagnostic e)
-sortMsgBag :: Maybe DynFlags -> Bag (ErrMsg e) -> [ErrMsg e]
+sortMsgBag :: Maybe DynFlags -> Bag (MsgEnvelope e) -> [MsgEnvelope e]
sortMsgBag dflags = maybeLimit . sortBy (cmp `on` errMsgSpan) . bagToList
where cmp
| fromMaybe False (fmap reverseErrors dflags) = SrcLoc.rightmost_smallest