Fix for "\000123" getting compiled to Lua as "\0123"
This commit is contained in:
parent
70b8ee9070
commit
77ebe2fb2a
@ -55,7 +55,7 @@ local function repr(x, mt_behavior)
|
||||
local escaped = gsub(x, "\\", "\\\\")
|
||||
escaped = gsub(escaped, "\n", "\\n")
|
||||
escaped = gsub(escaped, '"', '\\"')
|
||||
escaped = gsub(escaped, "[%c%z]", function(c) return "\\"..c:byte() end)
|
||||
escaped = gsub(escaped, "[%c%z]", function(c) return ("\\%03d"):format(c:byte()) end)
|
||||
return '"'..escaped..'"'
|
||||
else
|
||||
return tostring(x)
|
||||
|
Loading…
Reference in New Issue
Block a user