diff options
author | Araq <rumpf_a@web.de> | 2012-12-27 00:05:23 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-12-27 00:05:23 +0100 |
commit | 3020257559d3aa2455309ee3727599fe68274e32 (patch) | |
tree | e1efe748641a5c5ba04f562e283adf0270330b23 /compiler/msgs.nim | |
parent | df1e7b8021bfbd7d164cc00d1e8f8c000a620965 (diff) | |
download | Nim-3020257559d3aa2455309ee3727599fe68274e32.tar.gz |
implemented --listFullPaths option for aporia
Diffstat (limited to 'compiler/msgs.nim')
-rwxr-xr-x | compiler/msgs.nim | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim index 240115817..d88e4a513 100755 --- a/compiler/msgs.nim +++ b/compiler/msgs.nim @@ -531,7 +531,15 @@ proc ToFilename*(fileIdx: int32): string = proc toFullPath*(info: TLineInfo): string = if info.fileIndex < 0: result = "???" else: result = fileInfos[info.fileIndex].fullPath - + +proc ToMsgFilename*(info: TLineInfo): string = + if info.fileIndex < 0: result = "???" + else: + if gListFullPaths: + result = fileInfos[info.fileIndex].fullPath + else: + result = fileInfos[info.fileIndex].projPath + proc ToLinenumber*(info: TLineInfo): int {.inline.} = result = info.line @@ -622,7 +630,7 @@ proc writeContext(lastinfo: TLineInfo) = var info = lastInfo for i in countup(0, len(msgContext) - 1): if msgContext[i] != lastInfo and msgContext[i] != info: - MsgWriteln(posContextFormat % [toFilename(msgContext[i]), + MsgWriteln(posContextFormat % [toMsgFilename(msgContext[i]), coordToStr(msgContext[i].line), coordToStr(msgContext[i].col), getMessageStr(errInstantiationFrom, "")]) @@ -676,7 +684,7 @@ proc liMessage(info: TLineInfo, msg: TMsgKind, arg: string, ignoreMsg = optHints notin gOptions or msg notin gNotes frmt = posHintFormat inc(gHintCounter) - let s = frmt % [toFilename(info), coordToStr(info.line), + let s = frmt % [toMsgFilename(info), coordToStr(info.line), coordToStr(info.col), getMessageStr(msg, arg)] if not ignoreMsg: MsgWriteln(s) |