This commit is contained in:
phidias authored and GitHub committed 2026-11-17 14:02:50 +09:00
1 parent 16dba5a4e7
commit 91984d319c
4 files changed
+11

No files matched your search

+8
View File
@@ -127,6 +127,10 @@ end)
function Elements.parse(expression)
local cursor = 1
if #expression > 1000 then
return error({"", {"exp-gui_calculator.error"}, {"exp-gui_calculator.input_too_long"}}, 0)
end
local function skip_space()
while expression:sub(cursor, cursor) == " " do
cursor = cursor + 1
@@ -316,6 +320,10 @@ function Elements.parse(expression)
error({"", {"exp-gui_calculator.error"}, {"exp-gui_calculator.trailing", expression:sub(cursor, expression:len())}}, 0)
end
if result ~= result or result == math.huge or result == -math.huge then
error({"", {"exp-gui_calculator.error"}, result}, 0)
end
return value
end)