You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local t = {
["1111111111111111111111111"] = true,
["foo"] = true
}
util.serpent.block(t)
errorKey = [string "util/serpent.lua"]:101: bad argument #1 to 'format' (number has no integer representation)
stack traceback:
[C]: in function 'string.format'
[string "util/serpent.lua"]:101: in function <[string "util/serpent.lua"]:100>
[C]: in function 'string.gsub'
[string "util/serpent.lua"]:107: in function <[string "util/serpent.lua"]:105>
[C]: in function 'table.sort'
[string "util/serpent.lua"]:103: in upvalue 'alphanumsort'
[string "util/serpent.lua"]:167: in local 'val2str'
[string "util/serpent.lua"]:219: in function <[string "util/serpent.lua"]:51>
The text was updated successfully, but these errors were encountered:
@freedom12, you can set sortkeys option to false to disable key sorting or provide your own function that handles these values better.
BTW, what version of serpent are you using? I added the following test and it passed with the current serpent version (0.303):
local key1 = "1111111111111111111111111"
local a = { [key1] = true, ["foo"] = true}
local f = assert(loadstring('return '..serpent.line(a)),
"serializing table with a long numerical keys (as string): failed")
local _a = f()
assert(_a[key1] == true, "table with a long numerical key (as string): failed")
errorKey = [string "util/serpent.lua"]:101: bad argument #1 to 'format' (number has no integer representation)
stack traceback:
[C]: in function 'string.format'
[string "util/serpent.lua"]:101: in function <[string "util/serpent.lua"]:100>
[C]: in function 'string.gsub'
[string "util/serpent.lua"]:107: in function <[string "util/serpent.lua"]:105>
[C]: in function 'table.sort'
[string "util/serpent.lua"]:103: in upvalue 'alphanumsort'
[string "util/serpent.lua"]:167: in local 'val2str'
[string "util/serpent.lua"]:219: in function <[string "util/serpent.lua"]:51>
The text was updated successfully, but these errors were encountered: