summaryrefslogtreecommitdiff
path: root/server/meta/Lua 5.4/basic.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-06-28 16:50:43 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-06-28 16:50:43 +0800
commitcd115d5fb3ab4f176f5e1c82061e27ad2ab857dd (patch)
treece253b8bc11cfbcc6d565194396ac8176fa66617 /server/meta/Lua 5.4/basic.lua
parent12c658d8f569c52e88b09aadbd221387364276f4 (diff)
downloadlua-language-server-cd115d5fb3ab4f176f5e1c82061e27ad2ab857dd.zip
整理代码
Diffstat (limited to 'server/meta/Lua 5.4/basic.lua')
-rw-r--r--server/meta/Lua 5.4/basic.lua30
1 files changed, 20 insertions, 10 deletions
diff --git a/server/meta/Lua 5.4/basic.lua b/server/meta/Lua 5.4/basic.lua
index 637d9aec..25e4a43a 100644
--- a/server/meta/Lua 5.4/basic.lua
+++ b/server/meta/Lua 5.4/basic.lua
@@ -6,8 +6,7 @@ arg = {}
---@param v any
---@param message any {optional = 'self'}
---@return any
-function assert(v, message)
-end
+function assert(v, message) end
---@alias GCOption string
---| > '"collect"' # 做一次完整的垃圾收集循环。
@@ -25,21 +24,22 @@ end
---@param opt GCOption {optional = 'after'}
---@param arg integer {optional = 'self'}
---@return any
-function collectgarbage(opt, arg)
-end
+function collectgarbage(opt, arg) end
---- 当前解释器版本号。
-_VERSION = 'Lua 5.4'
+--- 打开该名字的文件,并执行文件中的 Lua 代码块。
+---@param filename string {optional = 'self'}
+---@return any
+function dofile(filename) end
+
+--- 内部储存有全局环境。
+_G = {}
--- 返回该键的下一个键及其关联的值。
---@param t table
---@param index any {optional = 'self'}
---@return any {name = 'key'}
---@return any {name = 'value'}
-local function next(t, index)
-end
-
-_G['next'] = next
+function next(t, index) end
--- 能迭代表 `t` 中的所有键值对。
---|```lua
@@ -52,5 +52,15 @@ _G['next'] = next
---@return table {name = 't'}
---@return any {name = 'key'}
function pairs(t)
+ --- 返回该键的下一个键及其关联的值。
+ ---@param t table
+ ---@param index any {optional = 'self'}
+ ---@return any {name = 'key'}
+ ---@return any {name = 'value'}
+ local function next(t, index) end
+
return next, t, nil
end
+
+--- 当前解释器版本号。
+_VERSION = 'Lua 5.4'