From cd115d5fb3ab4f176f5e1c82061e27ad2ab857dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 28 Jun 2019 16:50:43 +0800 Subject: =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/meta/Lua 5.4/basic.lua | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'server/meta/Lua 5.4/basic.lua') 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' -- cgit v1.2.3