diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2024-09-04 21:09:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-04 15:09:29 +0200 |
commit | 99f4cfa43850f4927aee329af6a461a22f483de2 (patch) | |
tree | eab3090cc383bb3b8b4a742625c69511e4937064 | |
parent | 6908fb4011945d746b80b4da9975e065fd32989e (diff) | |
download | Nim-99f4cfa43850f4927aee329af6a461a22f483de2.tar.gz |
remove unused nimStdlibVersion (#24060)
-rw-r--r-- | compiler/options.nim | 18 | ||||
-rw-r--r-- | config/config.nims | 2 |
2 files changed, 1 insertions, 19 deletions
diff --git a/compiler/options.nim b/compiler/options.nim index 34268259b..3b9c0c6c8 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -179,7 +179,6 @@ const cmdCtags, cmdBuildindex} type - NimVer* = tuple[major: int, minor: int, patch: int] TStringSeq* = seq[string] TGCMode* = enum # the selected GC gcUnselected = "unselected" @@ -396,7 +395,6 @@ type outDir*: AbsoluteDir jsonBuildFile*: AbsoluteFile prefixDir*, libpath*, nimcacheDir*: AbsoluteDir - nimStdlibVersion*: NimVer dllOverrides, moduleOverrides*, cfileSpecificOptions*: StringTableRef projectName*: string # holds a name like 'nim' projectPath*: AbsoluteDir # holds a path like /home/alice/projects/nim/compiler/ @@ -450,16 +448,6 @@ type clientProcessId*: int -proc parseNimVersion*(a: string): NimVer = - # could be moved somewhere reusable - result = default(NimVer) - if a.len > 0: - let b = a.split(".") - assert b.len == 3, a - template fn(i) = result[i] = b[i].parseInt # could be optimized if needed - fn(0) - fn(1) - fn(2) proc assignIfDefault*[T](result: var T, val: T, def = default(T)) = ## if `result` was already assigned to a value (that wasn't `def`), this is a noop. @@ -634,12 +622,6 @@ proc newPartialConfigRef*(): ConfigRef = proc cppDefine*(c: ConfigRef; define: string) = c.cppDefines.incl define -proc getStdlibVersion*(conf: ConfigRef): NimVer = - if conf.nimStdlibVersion == (0,0,0): - let s = conf.symbols.getOrDefault("nimVersion", "") - conf.nimStdlibVersion = s.parseNimVersion - result = conf.nimStdlibVersion - proc isDefined*(conf: ConfigRef; symbol: string): bool = if conf.symbols.hasKey(symbol): result = true diff --git a/config/config.nims b/config/config.nims index 4b8582d9c..b8979e8e3 100644 --- a/config/config.nims +++ b/config/config.nims @@ -20,4 +20,4 @@ when defined(nimStrictMode): switch("hintAsError", "ConvFromXtoItselfNotNeeded") # future work: XDeclaredButNotUsed -switch("define", "nimVersion:" & NimVersion) +switch("define", "nimVersion:" & NimVersion) # deadcode |