This commit is contained in:
Araq 2014-11-12 02:36:59 +01:00
commit b2f577df23
9 changed files with 104 additions and 26 deletions

View file

@ -450,7 +450,7 @@ type
projPath*: string # This is relative to the project's root
shortName*: string # short name of the module
quotedName*: PRope # cached quoted short name for codegen
# purpoes
# purposes
lines*: seq[PRope] # the source code of the module
# used for better error messages and
@ -789,6 +789,14 @@ proc writeSurroundingSrc(info: TLineInfo) =
msgWriteln(indent & info.sourceLine.ropeToStr)
msgWriteln(indent & repeatChar(info.col, ' ') & '^')
proc formatMsg*(info: TLineInfo, msg: TMsgKind, arg: string): string =
let frmt = case msg
of warnMin..warnMax: PosWarningFormat
of hintMin..hintMax: PosHintFormat
else: PosErrorFormat
result = frmt % [toMsgFilename(info), coordToStr(info.line),
coordToStr(info.col), getMessageStr(msg, arg)]
proc liMessage(info: TLineInfo, msg: TMsgKind, arg: string,
eh: TErrorHandling) =
var frmt: string