cleaned up strutils.nim

This commit is contained in:
Araq 2017-11-28 01:10:57 +01:00
commit 653dcb8027

View file

@ -32,10 +32,6 @@ when defined(nimOldSplit):
else: else:
{.pragma: deprecatedSplit.} {.pragma: deprecatedSplit.}
type
CharSet* {.deprecated.} = set[char] # for compatibility with Nim
{.deprecated: [TCharSet: CharSet].}
const const
Whitespace* = {' ', '\t', '\v', '\r', '\l', '\f'} Whitespace* = {' ', '\t', '\v', '\r', '\l', '\f'}
## All the characters that count as whitespace. ## All the characters that count as whitespace.
@ -82,7 +78,7 @@ proc isAlphaNumeric*(c: char): bool {.noSideEffect, procvar,
## Checks whether or not `c` is alphanumeric. ## Checks whether or not `c` is alphanumeric.
## ##
## This checks a-z, A-Z, 0-9 ASCII characters only. ## This checks a-z, A-Z, 0-9 ASCII characters only.
return c in Letters or c in Digits return c in Letters+Digits
proc isDigit*(c: char): bool {.noSideEffect, procvar, proc isDigit*(c: char): bool {.noSideEffect, procvar,
rtl, extern: "nsuIsDigitChar".} = rtl, extern: "nsuIsDigitChar".} =
@ -123,7 +119,7 @@ proc isAlphaAscii*(s: string): bool {.noSideEffect, procvar,
result = true result = true
for c in s: for c in s:
result = c.isAlphaAscii() and result if not c.isAlphaAscii(): return false
proc isAlphaNumeric*(s: string): bool {.noSideEffect, procvar, proc isAlphaNumeric*(s: string): bool {.noSideEffect, procvar,
rtl, extern: "nsuIsAlphaNumericStr".} = rtl, extern: "nsuIsAlphaNumericStr".} =