mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-20 23:33:12 +09:00
.
This commit is contained in:
1 parent
16dba5a4e7
commit
91984d319c
4 files changed
+11
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user