Ascii character code 127 (DEL) is not printable and must be quoted. (#5984)

This is a follow-up to #5823.
This commit is contained in:
Markus F.X.J. Oberhumer 2017-06-15 20:42:23 +02:00 • committed by Andreas Rumpf
commit a0f39e0ab4
6 changed files with 9 additions and 9 deletions

View file

@ -49,7 +49,7 @@ proc reprStrAux(result: var string, s: cstring; len: int) =
of '"': add result, "\\\""
of '\\': add result, "\\\\" # BUGFIX: forgotten
of '\10': add result, "\\10\"\n\"" # " \n " # better readability
of '\128' .. '\255', '\0'..'\9', '\11'..'\31':
of '\127' .. '\255', '\0'..'\9', '\11'..'\31':
add result, "\\" & reprInt(ord(c))
else:
result.add(c)
@ -68,7 +68,7 @@ proc reprChar(x: char): string {.compilerRtl.} =
case x
of '"': add result, "\\\""
of '\\': add result, "\\\\"
of '\128' .. '\255', '\0'..'\31': add result, "\\" & reprInt(ord(x))
of '\127' .. '\255', '\0'..'\31': add result, "\\" & reprInt(ord(x))
else: add result, x
add result, "\'"