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)
+1
View File
@@ -273,6 +273,7 @@ inserted=Inserted __1__ __2__ into __3__
tooltip=Calculator
info_tooltip=Supported Operators: + - * / % () ^ ** !\nPrefix: K M G T P\nBase: 0x 0b 0o\nFunction: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC
error=[ERROR]
input_too_long=Input too long
factorial_neg=Factorial of a negative number __1__
factorial_large=Factorial too large __1__
factorial_int=Factorial must be an integer __1__
+1
View File
@@ -275,6 +275,7 @@ inserted=自動填入 __1__ __2__ 到 __3__
tooltip=計算機
info_tooltip=支援的運算符: + - * / % () ^ ** !\n詞頭: K M G T P\n進制: 0x 0b 0o\n函數: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC
error=[錯誤]
input_too_long=輸入太長
factorial_neg=負數的階乘 __1__
factorial_large=階乘太大 __1__
factorial_int=階乘必須是整數 __1__
+1
View File
@@ -275,6 +275,7 @@ inserted=自動填入 __1__ __2__ 到 __3__
tooltip=計算機
info_tooltip=支援的運算符: + - * / % () ^ ** !\n詞頭: K M G T P\n進制: 0x 0b 0o\n函數: ABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC
error=[錯誤]
input_too_long=輸入太長
factorial_neg=負數的階乘 __1__
factorial_large=階乘太大 __1__
factorial_int=階乘必須是整數 __1__