summaryrefslogtreecommitdiff
path: root/server/src/utility/table.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-05 16:13:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-05 16:13:23 +0800
commit118e6cc829235f721c12b8154f72a627bb8835d5 (patch)
tree4b6d9fd465c1d2c6178681085a980ea017a2732c /server/src/utility/table.lua
parentccab9b5c2439c51b345721e79e13fef18c27185d (diff)
downloadlua-language-server-118e6cc829235f721c12b8154f72a627bb8835d5.zip
使用英文
Diffstat (limited to 'server/src/utility/table.lua')
-rw-r--r--server/src/utility/table.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/src/utility/table.lua b/server/src/utility/table.lua
index 37a74632..1c6b21d1 100644
--- a/server/src/utility/table.lua
+++ b/server/src/utility/table.lua
@@ -14,14 +14,14 @@ local KEY = {}
function table.dump(tbl)
if type(tbl) ~= 'table' then
- error('必须是表')
+ error('Must be a table')
end
local table_mark = {}
local lines = {}
lines[#lines+1] = '{'
local function unpack(tbl, tab)
if table_mark[tbl] then
- error('不能循环引用')
+ error('Cyclic references are not allowed.')
end
table_mark[tbl] = true
local keys = {}
@@ -35,7 +35,7 @@ function table.dump(tbl)
elseif math_type(key) == 'integer' then
KEY[key] = ('[%d]'):format(key)
else
- error('必须使用字符串或整数作为键')
+ error('Key must be `string` or `integer`')
end
keys[#keys+1] = key
end
@@ -52,7 +52,7 @@ function table.dump(tbl)
elseif tp == 'string' or tp == 'number' or tp == 'boolean' then
lines[#lines+1] = ('%s%s = %q,'):format(TAB[tab+1], KEY[key], value)
else
- error(('不支持的值类型[%s]'):format(tp))
+ error(('Unsupport value type: [%s]'):format(tp))
end
end
end