diff options
author | Markus F.X.J. Oberhumer <markus.oberhumer@oberhumer.com> | 2017-06-15 20:42:23 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-06-15 20:42:23 +0200 |
commit | a0f39e0ab4b050a0ef189917e3892a07f92b57dc (patch) | |
tree | 76b392a0a77214f2ea440b6e7f31c21430d227c7 /lib/system/reprjs.nim | |
parent | 6ca9ad6608b92246198b613c40dcea8ee2b36b5d (diff) | |
download | Nim-a0f39e0ab4b050a0ef189917e3892a07f92b57dc.tar.gz |
Ascii character code 127 (DEL) is not printable and must be quoted. (#5984)
This is a follow-up to #5823.
Diffstat (limited to 'lib/system/reprjs.nim')
-rw-r--r-- | lib/system/reprjs.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/reprjs.nim b/lib/system/reprjs.nim index 6b0e32191..5c265a891 100644 --- a/lib/system/reprjs.nim +++ b/lib/system/reprjs.nim @@ -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. |