Remove the uses of {.procvar.} pragma (#14359)
This pragma did nothing. Ref: - https://github.com/nim-lang/Nim/issues/2172#issuecomment-383276469 - https://github.com/nim-lang/Nim/issues/12975
This commit is contained in:
parent
ce0552c100
commit
bf0e1c696f
13 changed files with 67 additions and 68 deletions
|
|
@ -119,7 +119,7 @@ const
|
|||
## doAssert "01234".find(invalid) == -1
|
||||
## doAssert "01A34".find(invalid) == 2
|
||||
|
||||
proc isAlphaAscii*(c: char): bool {.noSideEffect, procvar,
|
||||
proc isAlphaAscii*(c: char): bool {.noSideEffect,
|
||||
rtl, extern: "nsuIsAlphaAsciiChar".} =
|
||||
## Checks whether or not character `c` is alphabetical.
|
||||
##
|
||||
|
|
@ -131,7 +131,7 @@ proc isAlphaAscii*(c: char): bool {.noSideEffect, procvar,
|
|||
doAssert isAlphaAscii('8') == false
|
||||
return c in Letters
|
||||
|
||||
proc isAlphaNumeric*(c: char): bool {.noSideEffect, procvar,
|
||||
proc isAlphaNumeric*(c: char): bool {.noSideEffect,
|
||||
rtl, extern: "nsuIsAlphaNumericChar".} =
|
||||
## Checks whether or not `c` is alphanumeric.
|
||||
##
|
||||
|
|
@ -142,7 +142,7 @@ proc isAlphaNumeric*(c: char): bool {.noSideEffect, procvar,
|
|||
doAssert isAlphaNumeric(' ') == false
|
||||
return c in Letters+Digits
|
||||
|
||||
proc isDigit*(c: char): bool {.noSideEffect, procvar,
|
||||
proc isDigit*(c: char): bool {.noSideEffect,
|
||||
rtl, extern: "nsuIsDigitChar".} =
|
||||
## Checks whether or not `c` is a number.
|
||||
##
|
||||
|
|
@ -152,7 +152,7 @@ proc isDigit*(c: char): bool {.noSideEffect, procvar,
|
|||
doAssert isDigit('8') == true
|
||||
return c in Digits
|
||||
|
||||
proc isSpaceAscii*(c: char): bool {.noSideEffect, procvar,
|
||||
proc isSpaceAscii*(c: char): bool {.noSideEffect,
|
||||
rtl, extern: "nsuIsSpaceAsciiChar".} =
|
||||
## Checks whether or not `c` is a whitespace character.
|
||||
runnableExamples:
|
||||
|
|
@ -161,7 +161,7 @@ proc isSpaceAscii*(c: char): bool {.noSideEffect, procvar,
|
|||
doAssert isSpaceAscii('\t') == true
|
||||
return c in Whitespace
|
||||
|
||||
proc isLowerAscii*(c: char): bool {.noSideEffect, procvar,
|
||||
proc isLowerAscii*(c: char): bool {.noSideEffect,
|
||||
rtl, extern: "nsuIsLowerAsciiChar".} =
|
||||
## Checks whether or not `c` is a lower case character.
|
||||
##
|
||||
|
|
@ -176,7 +176,7 @@ proc isLowerAscii*(c: char): bool {.noSideEffect, procvar,
|
|||
doAssert isLowerAscii('7') == false
|
||||
return c in {'a'..'z'}
|
||||
|
||||
proc isUpperAscii*(c: char): bool {.noSideEffect, procvar,
|
||||
proc isUpperAscii*(c: char): bool {.noSideEffect,
|
||||
rtl, extern: "nsuIsUpperAsciiChar".} =
|
||||
## Checks whether or not `c` is an upper case character.
|
||||
##
|
||||
|
|
@ -192,7 +192,7 @@ proc isUpperAscii*(c: char): bool {.noSideEffect, procvar,
|
|||
return c in {'A'..'Z'}
|
||||
|
||||
|
||||
proc toLowerAscii*(c: char): char {.noSideEffect, procvar,
|
||||
proc toLowerAscii*(c: char): char {.noSideEffect,
|
||||
rtl, extern: "nsuToLowerAsciiChar".} =
|
||||
## Returns the lower case version of character ``c``.
|
||||
##
|
||||
|
|
@ -216,7 +216,7 @@ template toImpl(call) =
|
|||
for i in 0..len(s) - 1:
|
||||
result[i] = call(s[i])
|
||||
|
||||
proc toLowerAscii*(s: string): string {.noSideEffect, procvar,
|
||||
proc toLowerAscii*(s: string): string {.noSideEffect,
|
||||
rtl, extern: "nsuToLowerAsciiStr".} =
|
||||
## Converts string `s` into lower case.
|
||||
##
|
||||
|
|
@ -230,7 +230,7 @@ proc toLowerAscii*(s: string): string {.noSideEffect, procvar,
|
|||
doAssert toLowerAscii("FooBar!") == "foobar!"
|
||||
toImpl toLowerAscii
|
||||
|
||||
proc toUpperAscii*(c: char): char {.noSideEffect, procvar,
|
||||
proc toUpperAscii*(c: char): char {.noSideEffect,
|
||||
rtl, extern: "nsuToUpperAsciiChar".} =
|
||||
## Converts character `c` into upper case.
|
||||
##
|
||||
|
|
@ -250,7 +250,7 @@ proc toUpperAscii*(c: char): char {.noSideEffect, procvar,
|
|||
else:
|
||||
result = c
|
||||
|
||||
proc toUpperAscii*(s: string): string {.noSideEffect, procvar,
|
||||
proc toUpperAscii*(s: string): string {.noSideEffect,
|
||||
rtl, extern: "nsuToUpperAsciiStr".} =
|
||||
## Converts string `s` into upper case.
|
||||
##
|
||||
|
|
@ -264,7 +264,7 @@ proc toUpperAscii*(s: string): string {.noSideEffect, procvar,
|
|||
doAssert toUpperAscii("FooBar!") == "FOOBAR!"
|
||||
toImpl toUpperAscii
|
||||
|
||||
proc capitalizeAscii*(s: string): string {.noSideEffect, procvar,
|
||||
proc capitalizeAscii*(s: string): string {.noSideEffect,
|
||||
rtl, extern: "nsuCapitalizeAscii".} =
|
||||
## Converts the first character of string `s` into upper case.
|
||||
##
|
||||
|
|
@ -299,7 +299,7 @@ proc nimIdentNormalize*(s: string): string =
|
|||
inc j
|
||||
if j != s.len: setLen(result, j)
|
||||
|
||||
proc normalize*(s: string): string {.noSideEffect, procvar,
|
||||
proc normalize*(s: string): string {.noSideEffect,
|
||||
rtl, extern: "nsuNormalize".} =
|
||||
## Normalizes the string `s`.
|
||||
##
|
||||
|
|
@ -323,7 +323,7 @@ proc normalize*(s: string): string {.noSideEffect, procvar,
|
|||
if j != s.len: setLen(result, j)
|
||||
|
||||
proc cmpIgnoreCase*(a, b: string): int {.noSideEffect,
|
||||
rtl, extern: "nsuCmpIgnoreCase", procvar.} =
|
||||
rtl, extern: "nsuCmpIgnoreCase".} =
|
||||
## Compares two strings in a case insensitive manner. Returns:
|
||||
##
|
||||
## | 0 if a == b
|
||||
|
|
@ -345,7 +345,7 @@ proc cmpIgnoreCase*(a, b: string): int {.noSideEffect,
|
|||
# thus we compile without checks here
|
||||
|
||||
proc cmpIgnoreStyle*(a, b: string): int {.noSideEffect,
|
||||
rtl, extern: "nsuCmpIgnoreStyle", procvar.} =
|
||||
rtl, extern: "nsuCmpIgnoreStyle".} =
|
||||
## Semantically the same as ``cmp(normalize(a), normalize(b))``. It
|
||||
## is just optimized to not allocate temporary strings. This should
|
||||
## NOT be used to compare Nim identifier names.
|
||||
|
|
@ -1096,7 +1096,7 @@ proc intToStr*(x: int, minchars: Positive = 1): string {.noSideEffect,
|
|||
if x < 0:
|
||||
result = '-' & result
|
||||
|
||||
proc parseInt*(s: string): int {.noSideEffect, procvar,
|
||||
proc parseInt*(s: string): int {.noSideEffect,
|
||||
rtl, extern: "nsuParseInt".} =
|
||||
## Parses a decimal integer value contained in `s`.
|
||||
##
|
||||
|
|
@ -1107,7 +1107,7 @@ proc parseInt*(s: string): int {.noSideEffect, procvar,
|
|||
if L != s.len or L == 0:
|
||||
raise newException(ValueError, "invalid integer: " & s)
|
||||
|
||||
proc parseBiggestInt*(s: string): BiggestInt {.noSideEffect, procvar,
|
||||
proc parseBiggestInt*(s: string): BiggestInt {.noSideEffect,
|
||||
rtl, extern: "nsuParseBiggestInt".} =
|
||||
## Parses a decimal integer value contained in `s`.
|
||||
##
|
||||
|
|
@ -1116,7 +1116,7 @@ proc parseBiggestInt*(s: string): BiggestInt {.noSideEffect, procvar,
|
|||
if L != s.len or L == 0:
|
||||
raise newException(ValueError, "invalid integer: " & s)
|
||||
|
||||
proc parseUInt*(s: string): uint {.noSideEffect, procvar,
|
||||
proc parseUInt*(s: string): uint {.noSideEffect,
|
||||
rtl, extern: "nsuParseUInt".} =
|
||||
## Parses a decimal unsigned integer value contained in `s`.
|
||||
##
|
||||
|
|
@ -1125,7 +1125,7 @@ proc parseUInt*(s: string): uint {.noSideEffect, procvar,
|
|||
if L != s.len or L == 0:
|
||||
raise newException(ValueError, "invalid unsigned integer: " & s)
|
||||
|
||||
proc parseBiggestUInt*(s: string): BiggestUInt {.noSideEffect, procvar,
|
||||
proc parseBiggestUInt*(s: string): BiggestUInt {.noSideEffect,
|
||||
rtl, extern: "nsuParseBiggestUInt".} =
|
||||
## Parses a decimal unsigned integer value contained in `s`.
|
||||
##
|
||||
|
|
@ -1134,7 +1134,7 @@ proc parseBiggestUInt*(s: string): BiggestUInt {.noSideEffect, procvar,
|
|||
if L != s.len or L == 0:
|
||||
raise newException(ValueError, "invalid unsigned integer: " & s)
|
||||
|
||||
proc parseFloat*(s: string): float {.noSideEffect, procvar,
|
||||
proc parseFloat*(s: string): float {.noSideEffect,
|
||||
rtl, extern: "nsuParseFloat".} =
|
||||
## Parses a decimal floating point value contained in `s`.
|
||||
##
|
||||
|
|
@ -1147,7 +1147,7 @@ proc parseFloat*(s: string): float {.noSideEffect, procvar,
|
|||
if L != s.len or L == 0:
|
||||
raise newException(ValueError, "invalid float: " & s)
|
||||
|
||||
proc parseBinInt*(s: string): int {.noSideEffect, procvar,
|
||||
proc parseBinInt*(s: string): int {.noSideEffect,
|
||||
rtl, extern: "nsuParseBinInt".} =
|
||||
## Parses a binary integer value contained in `s`.
|
||||
##
|
||||
|
|
@ -1176,7 +1176,7 @@ proc parseOctInt*(s: string): int {.noSideEffect,
|
|||
if L != s.len or L == 0:
|
||||
raise newException(ValueError, "invalid oct integer: " & s)
|
||||
|
||||
proc parseHexInt*(s: string): int {.noSideEffect, procvar,
|
||||
proc parseHexInt*(s: string): int {.noSideEffect,
|
||||
rtl, extern: "nsuParseHexInt".} =
|
||||
## Parses a hexadecimal integer value contained in `s`.
|
||||
##
|
||||
|
|
@ -1202,7 +1202,7 @@ proc generateHexCharToValueMap(): string =
|
|||
|
||||
const hexCharToValueMap = generateHexCharToValueMap()
|
||||
|
||||
proc parseHexStr*(s: string): string {.noSideEffect, procvar,
|
||||
proc parseHexStr*(s: string): string {.noSideEffect,
|
||||
rtl, extern: "nsuParseHexStr".} =
|
||||
## Convert hex-encoded string to byte string, e.g.:
|
||||
##
|
||||
|
|
@ -2918,12 +2918,12 @@ iterator tokenize*(s: string, seps: set[char] = Whitespace): tuple[
|
|||
break
|
||||
i = j
|
||||
|
||||
proc isEmptyOrWhitespace*(s: string): bool {.noSideEffect, procvar, rtl,
|
||||
proc isEmptyOrWhitespace*(s: string): bool {.noSideEffect, rtl,
|
||||
extern: "nsuIsEmptyOrWhitespace".} =
|
||||
## Checks if `s` is empty or consists entirely of whitespace characters.
|
||||
result = s.allCharsInSet(Whitespace)
|
||||
|
||||
proc isNilOrWhitespace*(s: string): bool {.noSideEffect, procvar, rtl,
|
||||
proc isNilOrWhitespace*(s: string): bool {.noSideEffect, rtl,
|
||||
extern: "nsuIsNilOrWhitespace",
|
||||
deprecated: "use isEmptyOrWhitespace instead".} =
|
||||
## Alias for isEmptyOrWhitespace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue