From 9055b5493d99a31cdc8fd6cdd1f49397ff2eea3c Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Thu, 21 May 2020 09:26:54 -0700 Subject: [PATCH] fixup --- compiler/msgs.nim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 530fa1e0287db..38725944a8859 100644 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -479,8 +479,8 @@ proc liMessage(conf: ConfigRef; info: TLineInfo, msg: TMsgKind, arg: string, title = HintTitle color = HintColor inc(conf.hintCounter) - let s = getMessageStr(msg, arg) + let s = if isRaw: arg else: getMessageStr(msg, arg) if not ignoreMsg: let loc = if info != unknownLineInfo: conf.toFileLineCol(info) & " " else: "" var kindmsg = if kind.len > 0: KindFormat % kind else: "" @@ -503,8 +503,7 @@ proc rawMessage*(conf: ConfigRef; msg: TMsgKind, args: openArray[string]) = proc rawMessage*(conf: ConfigRef; msg: TMsgKind, arg: string) = const info2 = instantiationInfo(-1, fullPaths = true) - let arg = msgKindToString(msg) % arg - liMessage(conf, unknownLineInfo, msg, arg = arg, eh = doAbort, info2, isRaw = true) + liMessage(conf, unknownLineInfo, msg, arg = arg, eh = doAbort, info2) template fatal*(conf: ConfigRef; info: TLineInfo, msg: TMsgKind, arg = "") = # this fixes bug #7080 so that it is at least obvious 'fatal' @@ -546,16 +545,16 @@ template internalError*(conf: ConfigRef; info: TLineInfo, errMsg: string) = const info2 = instantiationInfo(-1, fullPaths = true) internalErrorImpl(conf, info, errMsg, info2) -proc internalError*(conf: ConfigRef; errMsg: string) = - # xxx refactor with `internalError` overload - if conf.cmd == cmdIdeTools and conf.structuredErrorHook.isNil: return - writeContext(conf, unknownLineInfo) - rawMessage(conf, errInternal, errMsg) +template internalError*(conf: ConfigRef; errMsg: string) = + const info2 = instantiationInfo(-1, fullPaths = true) + internalErrorImpl(conf, unknownLineInfo, errMsg, info2) +# PRTEMP template assertNotNil*(conf: ConfigRef; e): untyped = if e == nil: internalError(conf, $instantiationInfo()) e +# PRTEMP template internalAssert*(conf: ConfigRef, e: bool) = if not e: internalError(conf, $instantiationInfo()) @@ -583,6 +582,7 @@ proc listHints*(conf: ConfigRef) = lineinfos.HintsToStr[ord(hint) - ord(hintMin)] ]) +# PRTEMP proc lintReport*(conf: ConfigRef; info: TLineInfo, beau, got: string) = let m = "'$2' should be: '$1'" % [beau, got] if optStyleError in conf.globalOptions: