diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-06-13 01:44:19 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-06-13 01:44:19 +0200 |
commit | 5348fef00326aabbb596b2ee7d0925fe10bbf7c6 (patch) | |
tree | 5476af33306aa2d20b1a009e63664d11b6cea9ca /compiler/nimfix/prettybase.nim | |
parent | f555338ce8b4053bec48ee2ba8299a757db1ee67 (diff) | |
download | Nim-5348fef00326aabbb596b2ee7d0925fe10bbf7c6.tar.gz |
implements a --nep1:on switch to make the compiler enforce the naming conventions outlined in NEP-1
Diffstat (limited to 'compiler/nimfix/prettybase.nim')
-rw-r--r-- | compiler/nimfix/prettybase.nim | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/compiler/nimfix/prettybase.nim b/compiler/nimfix/prettybase.nim index d1ad41a6e..c3e16e5ba 100644 --- a/compiler/nimfix/prettybase.nim +++ b/compiler/nimfix/prettybase.nim @@ -7,21 +7,11 @@ # distribution, for details about the copyright. # -import strutils, lexbase, streams -import ".." / [ast, msgs, lineinfos, idents, options] +import strutils except Letters +import lexbase, streams +import ".." / [ast, msgs, lineinfos, idents, options, linter] from os import splitFile -const - Letters* = {'a'..'z', 'A'..'Z', '0'..'9', '\x80'..'\xFF', '_'} - -proc identLen*(line: string, start: int): int = - while start+result < line.len and line[start+result] in Letters: - inc result - -proc differ*(line: string, a, b: int, x: string): bool = - let y = line[a..b] - result = cmpIgnoreStyle(y, x) == 0 and y != x - proc replaceDeprecated*(conf: ConfigRef; info: TLineInfo; oldSym, newSym: PIdent) = let line = sourceLine(conf, info) var first = min(info.col.int, line.len) |