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
TOML supports integer values in other bases, so it would be nice if this could be parsed. I tried inserting the code below to the parseNumber function, right after line 222, and it looks like it works ok.
local prefixes = { ["0x"] = 16, ["0o"] = 8, ["0b"] = 2 }
local base = prefixes[char(0) .. char(1)]
if base then
step(2)
local digits = ({ [2] = "[01]", [8] = "[0-7]", [16] = "%x" })[base]
while(bounds()) do
if char():match(digits) then
num = num .. char()
elseif char():match(ws) or char() == "#" or char():match(nl) or char() == "," or char() == "]" or char() == "}" then
break
elseif char() ~= "_" then
err("Invalid number")
end
step()
end
if num == "" then
err("Invalid number")
end
return {value = tonumber(num, base), type = "int"}
end
The text was updated successfully, but these errors were encountered:
TOML supports integer values in other bases, so it would be nice if this could be parsed. I tried inserting the code below to the
parseNumber
function, right after line 222, and it looks like it works ok.The text was updated successfully, but these errors were encountered: