make case-object transitions explicit, make unknownLineInfo a const, replace a few magic numbers with consts (#13170)
This commit is contained in:
parent
2bf337abae
commit
796aafe7e0
35 changed files with 182 additions and 203 deletions
|
|
@ -236,11 +236,7 @@ proc raiseRecoverableError*(msg: string) {.noinline.} =
|
|||
|
||||
const
|
||||
InvalidFileIdx* = FileIndex(-1)
|
||||
|
||||
proc unknownLineInfo*(): TLineInfo =
|
||||
result.line = uint16(0)
|
||||
result.col = int16(-1)
|
||||
result.fileIndex = InvalidFileIdx
|
||||
unknownLineInfo* = TLineInfo(line: 0, col: -1, fileIndex: InvalidFileIdx)
|
||||
|
||||
type
|
||||
Severity* {.pure.} = enum ## VS Code only supports these three
|
||||
|
|
@ -267,7 +263,7 @@ type
|
|||
|
||||
proc initMsgConfig*(): MsgConfig =
|
||||
result.msgContext = @[]
|
||||
result.lastError = unknownLineInfo()
|
||||
result.lastError = unknownLineInfo
|
||||
result.filenameToIndexTbl = initTable[string, FileIndex]()
|
||||
result.fileInfos = @[]
|
||||
result.errorOutputs = {eStdOut, eStdErr}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue