Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected definitions for string.pack and string.unpack #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/resources/std/Lua53/string.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ function string.match(s, pattern, init) end
--- Returns a binary string containing the values `v1`, `v2`, etc. packed (that
--- is, serialized in binary form) according to the format string `fmt`.
---@param fmt string
---@param v1 string
---@param v2 string
---@param v1 number
---@vararg number
---@return string
function string.pack(fmt, v1, v2, ...) end
function string.pack(fmt, v1, ...) end

---
--- Returns the size of a string resulting from `string.pack` with the given
Expand Down Expand Up @@ -302,11 +302,11 @@ function string.sub(s, i, j) end
--- `fmt`. An optional `pos` marks where to start reading in `s` (default is 1).
--- After the read values, this function also returns the index of the first
--- unread byte in `s`.
---@overload fun(fmt:string, s:string):string
---@overload fun(fmt:string, s:string):number...
---@param fmt string
---@param s string
---@param pos number
---@return string
---@return number...
function string.unpack(fmt, s, pos) end

---
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/std/Lua54/string.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ function string.match(s, pattern, init) end
--- Returns a binary string containing the values `v1`, `v2`, etc. packed (that
--- is, serialized in binary form) according to the format string `fmt`.
---@param fmt string
---@param v1 string
---@param v2 string
---@param v1 number
---@vararg number
---@return string
function string.pack(fmt, v1, v2, ...) end
function string.pack(fmt, v1, ...) end

---
--- Returns the size of a string resulting from `string.pack` with the given
Expand Down Expand Up @@ -302,11 +302,11 @@ function string.sub(s, i, j) end
--- `fmt`. An optional `pos` marks where to start reading in `s` (default is 1).
--- After the read values, this function also returns the index of the first
--- unread byte in `s`.
---@overload fun(fmt:string, s:string):string
---@overload fun(fmt:string, s:string):number...
---@param fmt string
---@param s string
---@param pos number
---@return string
---@return number...
function string.unpack(fmt, s, pos) end

---
Expand Down