From 998f7b2331a290601d9c927b55a4995b8710661d Mon Sep 17 00:00:00 2001 From: Benjamin Dobell Date: Sat, 24 Jul 2021 02:48:45 +1000 Subject: [PATCH] Fixed Lua <= 5.1 os.exit type/documentation Closes #79 --- src/main/resources/std/Lua50/os.def.lua | 15 +++++---------- src/main/resources/std/Lua51/os.def.lua | 15 +++++---------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/main/resources/std/Lua50/os.def.lua b/src/main/resources/std/Lua50/os.def.lua index 4da15372..e4446237 100644 --- a/src/main/resources/std/Lua50/os.def.lua +++ b/src/main/resources/std/Lua50/os.def.lua @@ -102,18 +102,13 @@ function os.difftime(t2, t1) end function os.execute(command) end --- ---- Calls the ISO C function `exit` to terminate the host program. If `code` is ---- **true**, the returned status is `EXIT_SUCCESS`; if `code` is **false**, the ---- returned status is `EXIT_FAILURE`; if `code` is a number, the returned ---- status is this number. The default value for `code` is **true**. +--- Calls the C function `exit`, with an optional `code`, to terminate the host +--- program. The default value for `code` is the success code. --- ---- If the optional second argument `close` is true, closes the Lua state before ---- exiting. ----@overload fun():number +---@overload fun(): void ---@param code number ----@param close boolean ----@return number -function os.exit(code, close) end +---@return void @Never returns +function os.exit(code) end --- --- Returns the value of the process environment variable `varname`, or diff --git a/src/main/resources/std/Lua51/os.def.lua b/src/main/resources/std/Lua51/os.def.lua index 4da15372..e4446237 100644 --- a/src/main/resources/std/Lua51/os.def.lua +++ b/src/main/resources/std/Lua51/os.def.lua @@ -102,18 +102,13 @@ function os.difftime(t2, t1) end function os.execute(command) end --- ---- Calls the ISO C function `exit` to terminate the host program. If `code` is ---- **true**, the returned status is `EXIT_SUCCESS`; if `code` is **false**, the ---- returned status is `EXIT_FAILURE`; if `code` is a number, the returned ---- status is this number. The default value for `code` is **true**. +--- Calls the C function `exit`, with an optional `code`, to terminate the host +--- program. The default value for `code` is the success code. --- ---- If the optional second argument `close` is true, closes the Lua state before ---- exiting. ----@overload fun():number +---@overload fun(): void ---@param code number ----@param close boolean ----@return number -function os.exit(code, close) end +---@return void @Never returns +function os.exit(code) end --- --- Returns the value of the process environment variable `varname`, or