Skip to content

Commit

Permalink
fixes nim-lang#23513, parseutils.nim: parseInt's doc example.
Browse files Browse the repository at this point in the history
Also, the old `runnableExample` is just a copy of `proc parseInt(openArray[char], var int, int)` variant (in Line 1000).
  • Loading branch information
litlighilit committed May 2, 2024
1 parent f6c374b commit 999837c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/pure/parseutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,8 @@ proc parseInt*(s: openArray[char], number: var int): int {.
## `ValueError` is raised if the parsed integer is out of the valid range.
runnableExamples:
var res: int
doAssert parseInt("2019", res, 0) == 4
doAssert res == 2019
doAssert parseInt("2019", res, 2) == 2
doAssert res == 19
doAssert parseInt("-2024_05_02", res) == 11
doAssert res == -20240502
var res = BiggestInt(0)
result = parseBiggestInt(s, res)
when sizeof(int) <= 4:
Expand Down

0 comments on commit 999837c

Please sign in to comment.