diff options
author | Varriount <Varriount@users.noreply.github.com> | 2017-05-26 02:29:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-26 02:29:00 -0400 |
commit | fd0ab1df3efa51870d6746ed0ce6479f8934369d (patch) | |
tree | 388e056b99ae9c93703824eba65471160dd38161 | |
parent | bd47914f4cba0c70516f86752e7968033b1a0848 (diff) | |
parent | 87888e8129a7162cab546451ee3473d9bc5bbd63 (diff) | |
download | Nim-fd0ab1df3efa51870d6746ed0ce6479f8934369d.tar.gz |
Merge pull request #5823 from markus-oberhumer/ascii127-is-not-printable
Ascii character code 127 (DEL) is not printable.
-rw-r--r-- | compiler/astalgo.nim | 2 | ||||
-rw-r--r-- | compiler/ccgutils.nim | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 1fc8b7cea..ebe080468 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -219,7 +219,7 @@ proc rspaces(x: int): Rope = proc toYamlChar(c: char): string = case c - of '\0'..'\x1F', '\x80'..'\xFF': result = "\\u" & strutils.toHex(ord(c), 4) + of '\0'..'\x1F', '\x7F'..'\xFF': result = "\\u" & strutils.toHex(ord(c), 4) of '\'', '\"', '\\': result = '\\' & c else: result = $c diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index c37a8fcdb..c8e742de3 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -220,7 +220,7 @@ proc makeLLVMString*(s: string): Rope = add(result, rope(res)) setLen(res, 0) case s[i] - of '\0'..'\x1F', '\x80'..'\xFF', '\"', '\\': + of '\0'..'\x1F', '\x7F'..'\xFF', '\"', '\\': add(res, '\\') add(res, toHex(ord(s[i]), 2)) else: add(res, s[i]) |