Skip to content

Commit

Permalink
Fixed Lua <= 5.1 os.exit type/documentation
Browse files Browse the repository at this point in the history
Closes #79
  • Loading branch information
Benjamin-Dobell committed Jul 23, 2021
1 parent 01542fa commit 998f7b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
15 changes: 5 additions & 10 deletions src/main/resources/std/Lua50/os.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 5 additions & 10 deletions src/main/resources/std/Lua51/os.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 998f7b2

Please sign in to comment.