more modules updated
This commit is contained in:
parent
42f5a838a3
commit
00f50f2797
2 changed files with 7 additions and 7 deletions
|
|
@ -31,8 +31,8 @@ proc validEmailAddress*(s: string): bool {.noSideEffect,
|
||||||
inc(i)
|
inc(i)
|
||||||
if s[i] != '@': return false
|
if s[i] != '@': return false
|
||||||
var j = len(s)-1
|
var j = len(s)-1
|
||||||
if s[j] notin letters: return false
|
if s[j] notin Letters: return false
|
||||||
while j >= i and s[j] in letters: dec(j)
|
while j >= i and s[j] in Letters: dec(j)
|
||||||
inc(i) # skip '@'
|
inc(i) # skip '@'
|
||||||
while s[i] in {'0'..'9', 'a'..'z', '-', '.'}: inc(i)
|
while s[i] in {'0'..'9', 'a'..'z', '-', '.'}: inc(i)
|
||||||
if s[i] != '\0': return false
|
if s[i] != '\0': return false
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ proc normalize*(s: string): string {.noSideEffect, procvar,
|
||||||
if j != s.len: setLen(result, j)
|
if j != s.len: setLen(result, j)
|
||||||
|
|
||||||
proc cmpIgnoreCase*(a, b: string): int {.noSideEffect,
|
proc cmpIgnoreCase*(a, b: string): int {.noSideEffect,
|
||||||
rtl, extern: "nsuCmpIgnoreCase", procvar, operator: 4.} =
|
rtl, extern: "nsuCmpIgnoreCase", procvar.} =
|
||||||
## Compares two strings in a case insensitive manner. Returns:
|
## Compares two strings in a case insensitive manner. Returns:
|
||||||
##
|
##
|
||||||
## | 0 iff a == b
|
## | 0 iff a == b
|
||||||
|
|
@ -148,7 +148,7 @@ proc cmpIgnoreCase*(a, b: string): int {.noSideEffect,
|
||||||
# thus we compile without checks here
|
# thus we compile without checks here
|
||||||
|
|
||||||
proc cmpIgnoreStyle*(a, b: string): int {.noSideEffect,
|
proc cmpIgnoreStyle*(a, b: string): int {.noSideEffect,
|
||||||
rtl, extern: "nsuCmpIgnoreStyle", procvar, operator: 3.} =
|
rtl, extern: "nsuCmpIgnoreStyle", procvar.} =
|
||||||
## Compares two strings normalized (i.e. case and
|
## Compares two strings normalized (i.e. case and
|
||||||
## underscores do not matter). Returns:
|
## underscores do not matter). Returns:
|
||||||
##
|
##
|
||||||
|
|
@ -170,7 +170,7 @@ proc cmpIgnoreStyle*(a, b: string): int {.noSideEffect,
|
||||||
{.pop.}
|
{.pop.}
|
||||||
|
|
||||||
proc strip*(s: string, leading = true, trailing = true): string {.noSideEffect,
|
proc strip*(s: string, leading = true, trailing = true): string {.noSideEffect,
|
||||||
rtl, extern: "nsuStrip", operator: 5.} =
|
rtl, extern: "nsuStrip".} =
|
||||||
## Strips whitespace from `s` and returns the resulting string.
|
## Strips whitespace from `s` and returns the resulting string.
|
||||||
##
|
##
|
||||||
## If `leading` is true, leading whitespace is stripped.
|
## If `leading` is true, leading whitespace is stripped.
|
||||||
|
|
@ -1147,7 +1147,7 @@ type
|
||||||
|
|
||||||
proc formatBiggestFloat*(f: BiggestFloat, format: FloatFormatMode = ffDefault,
|
proc formatBiggestFloat*(f: BiggestFloat, format: FloatFormatMode = ffDefault,
|
||||||
precision: range[0..32] = 16): string {.
|
precision: range[0..32] = 16): string {.
|
||||||
noSideEffect, operator: 2, rtl, extern: "nsu$1".} =
|
noSideEffect, rtl, extern: "nsu$1".} =
|
||||||
## Converts a floating point value `f` to a string.
|
## Converts a floating point value `f` to a string.
|
||||||
##
|
##
|
||||||
## If ``format == ffDecimal`` then precision is the number of digits to
|
## If ``format == ffDecimal`` then precision is the number of digits to
|
||||||
|
|
@ -1178,7 +1178,7 @@ proc formatBiggestFloat*(f: BiggestFloat, format: FloatFormatMode = ffDefault,
|
||||||
|
|
||||||
proc formatFloat*(f: float, format: FloatFormatMode = ffDefault,
|
proc formatFloat*(f: float, format: FloatFormatMode = ffDefault,
|
||||||
precision: range[0..32] = 16): string {.
|
precision: range[0..32] = 16): string {.
|
||||||
noSideEffect, operator: 2, rtl, extern: "nsu$1".} =
|
noSideEffect, rtl, extern: "nsu$1".} =
|
||||||
## Converts a floating point value `f` to a string.
|
## Converts a floating point value `f` to a string.
|
||||||
##
|
##
|
||||||
## If ``format == ffDecimal`` then precision is the number of digits to
|
## If ``format == ffDecimal`` then precision is the number of digits to
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue