no more code duplication bw liMessage and rawMessage + several bug fixes (#14415)
* no more code duplication bw rawMessage and liMessage; fixes some bugs in rawMessage * all compiler messages work with hint:msgorigin
This commit is contained in:
parent
f7b73e6bfd
commit
0d0ea3a11e
6 changed files with 91 additions and 152 deletions
|
|
@ -181,6 +181,12 @@ const
|
|||
hintMin* = hintSuccess
|
||||
hintMax* = high(TMsgKind)
|
||||
|
||||
proc msgToStr*(msg: TMsgKind): string =
|
||||
case msg
|
||||
of warnMin..warnMax: WarningsToStr[ord(msg) - ord(warnMin)]
|
||||
of hintMin..hintMax: HintsToStr[ord(msg) - ord(hintMin)]
|
||||
else: "" # we could at least do $msg - prefix `err`
|
||||
|
||||
static:
|
||||
doAssert HintsToStr.len == ord(hintMax) - ord(hintMin) + 1
|
||||
doAssert WarningsToStr.len == ord(warnMax) - ord(warnMin) + 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue