added matchers.parseInt
This commit is contained in:
parent
b2746c4659
commit
b6ee92f384
1 changed files with 2 additions and 2 deletions
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
include "system/inclrtl"
|
||||
|
||||
import strutils
|
||||
import parseutils, strutils
|
||||
|
||||
proc validEmailAddress*(s: string): bool {.noSideEffect,
|
||||
rtl, extern: "nsuValidEmailAddress".} =
|
||||
|
|
@ -52,7 +52,7 @@ proc parseInt*(s: string, value: var int, validRange: TSlice[int]) {.
|
|||
## won't be overwritten.
|
||||
var x = value
|
||||
try:
|
||||
x = parseInt(s)
|
||||
discard parseutils.parseInt(s, x, 0)
|
||||
except EOverflow:
|
||||
nil
|
||||
if x in validRange: value = x
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue