diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2021-05-07 21:43:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-08 06:43:52 +0200 |
commit | e224865b3b1a45a1575fd62ec902ae4715659487 (patch) | |
tree | c461ff10254a9d87971704db47a78a862cb097ad /compiler/linter.nim | |
parent | d4850b524f903b628499d941cbee1ce1621d400c (diff) | |
download | Nim-e224865b3b1a45a1575fd62ec902ae4715659487.tar.gz |
add astmsgs; add `declared in` msg for usage lint errors (#17961)
* add astmsgs; add `declared in` msg for usage lint errors * fix test * fix tests/tools/tlinter.nim * std prefix
Diffstat (limited to 'compiler/linter.nim')
-rw-r--r-- | compiler/linter.nim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/linter.nim b/compiler/linter.nim index 7059689cf..5fb646051 100644 --- a/compiler/linter.nim +++ b/compiler/linter.nim @@ -9,9 +9,10 @@ ## This module implements the style checker. -import strutils +import std/strutils +from std/sugar import dup -import options, ast, msgs, idents, lineinfos, wordrecg +import options, ast, msgs, idents, lineinfos, wordrecg, astmsgs const Letters* = {'a'..'z', 'A'..'Z', '0'..'9', '\x80'..'\xFF', '_'} @@ -129,7 +130,7 @@ proc styleCheckUse*(conf: ConfigRef; info: TLineInfo; s: PSym) = if badName.len > 0: # special rules for historical reasons let forceHint = badName == "nnkArgList" and newName == "nnkArglist" or badName == "nnkArglist" and newName == "nnkArgList" - lintReport(conf, info, newName, badName, forceHint = forceHint) + lintReport(conf, info, newName, badName, forceHint = forceHint, extraMsg = "".dup(addDeclaredLoc(conf, s))) proc checkPragmaUse*(conf: ConfigRef; info: TLineInfo; w: TSpecialWord; pragmaName: string) = let wanted = $w |