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:
parent
6ca9ad6608
commit
a0f39e0ab4
6 changed files with 9 additions and 9 deletions
|
|
@ -44,7 +44,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, "\'")
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ proc reprStrAux(result: var string, s: cstring, len: int) =
|
|||
of '"': add(result, "\\\"")
|
||||
of '\\': add(result, "\\\\")
|
||||
of '\10': add(result, "\\10\"\n\"")
|
||||
of '\128'..'\255', '\0'..'\9', '\11'..'\31':
|
||||
of '\127'..'\255', '\0'..'\9', '\11'..'\31':
|
||||
add( result, "\\" & reprInt(ord(c)) )
|
||||
else:
|
||||
add( result, reprInt(ord(c)) ) # Not sure about this.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue