diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-08-06 20:26:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-06 14:26:21 +0200 |
commit | 93ced31353813c2f19c38a8c0af44737fa8d9f86 (patch) | |
tree | 715daec93fe236affb698f0b1963aafdef6b71af /compiler/nimblecmd.nim | |
parent | 53586d1f32dfe4f2e859178a3e43a6614520763f (diff) | |
download | Nim-93ced31353813c2f19c38a8c0af44737fa8d9f86.tar.gz |
use strictdefs for compiler (#22365)
* wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
Diffstat (limited to 'compiler/nimblecmd.nim')
-rw-r--r-- | compiler/nimblecmd.nim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/nimblecmd.nim b/compiler/nimblecmd.nim index 440d35fe5..97a66f1cd 100644 --- a/compiler/nimblecmd.nim +++ b/compiler/nimblecmd.nim @@ -37,11 +37,16 @@ proc isSpecial(ver: Version): bool = proc isValidVersion(v: string): bool = if v.len > 0: - if v[0] in {'#'} + Digits: return true + if v[0] in {'#'} + Digits: + result = true + else: + result = false + else: + result = false proc `<`*(ver: Version, ver2: Version): bool = ## This is synced from Nimble's version module. - + result = false # Handling for special versions such as "#head" or "#branch". if ver.isSpecial or ver2.isSpecial: if ver2.isSpecial and ($ver2).normalize == "#head": @@ -145,7 +150,7 @@ proc addNimblePath(conf: ConfigRef; p: string, info: TLineInfo) = conf.lazyPaths.insert(AbsoluteDir path, 0) proc addPathRec(conf: ConfigRef; dir: string, info: TLineInfo) = - var packages: PackageInfo + var packages: PackageInfo = initTable[string, tuple[version, checksum: string]]() var pos = dir.len-1 if dir[pos] in {DirSep, AltSep}: inc(pos) for k,p in os.walkDir(dir): |