diff options
author | Andy Davidoff <disruptek@users.noreply.github.com> | 2019-11-25 04:13:30 -0500 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-11-25 10:13:30 +0100 |
commit | bd8f49cbd30e35800e8b35dd33d61d7fc8c33b02 (patch) | |
tree | dc15c603f2c3e8992e1ea0b9061e588ef6d254db /lib | |
parent | 8debf798379041a09bf752cb9e2bf3d50f3395d1 (diff) | |
download | Nim-bd8f49cbd30e35800e8b35dd33d61d7fc8c33b02.tar.gz |
replace some runtime repr in stdlib for gc:arc (#12716)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/base64.nim | 4 | ||||
-rw-r--r-- | lib/pure/httpclient.nim | 2 | ||||
-rw-r--r-- | lib/pure/strutils.nim | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/pure/base64.nim b/lib/pure/base64.nim index 65cae2a1d..1e5cef32d 100644 --- a/lib/pure/base64.nim +++ b/lib/pure/base64.nim @@ -190,8 +190,8 @@ proc decode*(s: string): string = inc inputIndex if x == invalidChar: raise newException(ValueError, - "Invalid base64 format character " & repr(s[inputIndex]) & - " at location " & $inputIndex & ".") + "Invalid base64 format character `" & s[inputIndex] & + "` (ord " & $s[inputIndex].ord & ") at location " & $inputIndex & ".") template outputChar(x: untyped) = result[outputIndex] = char(x and 255) diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index d918be735..f7631773a 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -747,7 +747,7 @@ proc parseResponse(client: HttpClient | AsyncHttpClient, # Parse HTTP version info and status code. var le = skipIgnoreCase(line, "HTTP/", linei) if le <= 0: - httpError("invalid http version, " & line.repr) + httpError("invalid http version, `" & line & "`") inc(linei, le) le = skipIgnoreCase(line, "1.1", linei) if le > 0: result.version = "1.1" diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 72d9471d1..8e362a917 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -1206,7 +1206,8 @@ proc parseHexStr*(s: string): string {.noSideEffect, procvar, for pos, c in s: let val = hexCharToValueMap[ord(c)].ord if val == 17: - raise newException(ValueError, "Invalid hex char " & repr(c)) + raise newException(ValueError, "Invalid hex char `" & + c & "` (ord " & $c.ord & ")") if pos mod 2 == 0: buf = val else: |