diff options
author | --get-all <fesil@foxmail.com> | 2022-04-12 14:57:58 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-12 15:07:23 +0800 |
commit | 66504f8099f4369a9a436bfef12b6f1a92fbf084 (patch) | |
tree | c8f30aef9d009b3c1c06b820428ef54a0a36378f /meta/template | |
parent | 23f9c21952f1ddad594eb54b9d1cfbaf80b929ef (diff) | |
download | lua-language-server-66504f8099f4369a9a436bfef12b6f1a92fbf084.zip |
add table meta:foreach,foreachi,getn
Diffstat (limited to 'meta/template')
-rw-r--r-- | meta/template/table.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/meta/template/table.lua b/meta/template/table.lua index 3ec92ce8..21c8b619 100644 --- a/meta/template/table.lua +++ b/meta/template/table.lua @@ -64,4 +64,31 @@ function table.sort(list, comp) end ---@nodiscard function table.unpack(list, i, j) end +---@version <5.1, JIT +---#DES 'table.foreach' +---@generic T +---@param list any +---@param callback fun(key: string, value: any):T|nil +---@return T|nil +---@deprecated +function table.foreach(list, callback) end + +---@version <5.1, JIT +---#DES 'table.foreachi' +---@generic T +---@param list any +---@param callback fun(key: string, value: any):T|nil +---@return T|nil +---@deprecated +function table.foreachi(list, callback) end + +---@version <5.1, JIT +---#DES 'table.getn' +---@generic T +---@param list T[] +---@return integer +---@nodiscard +---@deprecated +function table.getn(list) end + return table |