Skip to content

Commit 3ba3307

Browse files
Araqnarimiran
authored andcommitted
remove deprecated procs (#12535)
1 parent ffa9a74 commit 3ba3307

39 files changed

+111
-567
lines changed

lib/impure/nre.nim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,13 @@ iterator items*(pattern: Captures,
357357

358358
proc toSeq*(pattern: CaptureBounds,
359359
default = none(HSlice[int, int])): seq[Option[HSlice[int, int]]] =
360-
accumulateResult(pattern.items(default))
360+
result = @[]
361+
for it in pattern.items(default): result.add it
361362

362363
proc toSeq*(pattern: Captures,
363364
default: Option[string] = none(string)): seq[Option[string]] =
364-
accumulateResult(pattern.items(default))
365+
result = @[]
366+
for it in pattern.items(default): result.add it
365367

366368
proc `$`*(pattern: RegexMatch): string =
367369
return pattern.captures[-1]

lib/pure/json.nim

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,6 @@ proc getBiggestInt*(n: JsonNode, default: BiggestInt = 0): BiggestInt =
234234
if n.isNil or n.kind != JInt: return default
235235
else: return n.num
236236

237-
proc getNum*(n: JsonNode, default: BiggestInt = 0): BiggestInt {.deprecated:
238-
"Deprecated since v0.18.2; use 'getInt' or 'getBiggestInt' instead".} =
239-
getBiggestInt(n, default)
240-
241237
proc getFloat*(n: JsonNode, default: float = 0.0): float =
242238
## Retrieves the float value of a `JFloat JsonNode`.
243239
##
@@ -248,21 +244,13 @@ proc getFloat*(n: JsonNode, default: float = 0.0): float =
248244
of JInt: return float(n.num)
249245
else: return default
250246

251-
proc getFNum*(n: JsonNode, default: float = 0.0): float {.deprecated:
252-
"Deprecated since v0.18.2; use 'getFloat' instead".} =
253-
getFloat(n, default)
254-
255247
proc getBool*(n: JsonNode, default: bool = false): bool =
256248
## Retrieves the bool value of a `JBool JsonNode`.
257249
##
258250
## Returns ``default`` if ``n`` is not a ``JBool``, or if ``n`` is nil.
259251
if n.isNil or n.kind != JBool: return default
260252
else: return n.bval
261253

262-
proc getBVal*(n: JsonNode, default: bool = false): bool {.deprecated:
263-
"Deprecated since v0.18.2; use 'getBool' instead".} =
264-
getBool(n, default)
265-
266254
proc getFields*(n: JsonNode,
267255
default = initOrderedTable[string, JsonNode](4)):
268256
OrderedTable[string, JsonNode] =
@@ -502,10 +490,6 @@ proc contains*(node: JsonNode, val: JsonNode): bool =
502490
assert(node.kind == JArray)
503491
find(node.elems, val) >= 0
504492

505-
proc existsKey*(node: JsonNode, key: string): bool {.
506-
deprecated: "use 'hasKey' instead".} =
507-
node.hasKey(key)
508-
509493
proc `{}`*(node: JsonNode, keys: varargs[string]): JsonNode =
510494
## Traverses the node and gets the given value. If any of the
511495
## keys do not exist, returns ``nil``. Also returns ``nil`` if one of the

lib/pure/os.nim

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141
## * `dynlib module <dynlib.html>`_
4242
## * `streams module <streams.html>`_
4343

44-
45-
{.deadCodeElim: on.} # dce option deprecated
46-
47-
{.push debugger: off.}
48-
4944
include "system/inclrtl"
5045

5146
import
@@ -3131,8 +3126,6 @@ proc getCurrentProcessId*(): int {.noNimScript.} =
31313126
else:
31323127
result = getpid()
31333128

3134-
{.pop.}
3135-
31363129
proc setLastModificationTime*(file: string, t: times.Time) {.noNimScript.} =
31373130
## Sets the `file`'s last modification time. `OSError` is raised in case of
31383131
## an error.

lib/pure/pegs.nim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,8 @@ proc findAll*(s: string, pattern: Peg, start = 0): seq[string] {.
11541154
noSideEffect, rtl, extern: "npegs$1".} =
11551155
## returns all matching *substrings* of `s` that match `pattern`.
11561156
## If it does not match, @[] is returned.
1157-
accumulateResult(findAll(s, pattern, start))
1157+
result = @[]
1158+
for it in findAll(s, pattern, start): result.add it
11581159

11591160
when not defined(nimhygiene):
11601161
{.pragma: inject.}
@@ -1372,7 +1373,8 @@ iterator split*(s: string, sep: Peg): string =
13721373
proc split*(s: string, sep: Peg): seq[string] {.
13731374
noSideEffect, rtl, extern: "npegs$1".} =
13741375
## Splits the string `s` into substrings.
1375-
accumulateResult(split(s, sep))
1376+
result = @[]
1377+
for it in split(s, sep): result.add it
13761378

13771379
# ------------------- scanner -------------------------------------------------
13781380

0 commit comments

Comments
 (0)