Skip to content

Commit b9d5ac8

Browse files
committed
std
1 parent 97d37fa commit b9d5ac8

File tree

5 files changed

+81
-16
lines changed

5 files changed

+81
-16
lines changed

src/main/resources/std/Lua50/debug.lua

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ function debug.getfenv(o) end
3737
---@return thread
3838
function debug.gethook(thread) end
3939

40+
---@class DebugInfo
41+
---@field linedefined number
42+
---@field lastlinedefined number
43+
---@field currentline number
44+
---@field func function
45+
---@field isvararg boolean
46+
---@field namewhat string
47+
---@field source string
48+
---@field nups number
49+
---@field what string
50+
---@field nparams number
51+
---@field short_src string
52+
4053
---
4154
--- Returns a table with information about a function. You can give the
4255
--- function directly, or you can give a number as the value of `f`,
@@ -57,11 +70,11 @@ function debug.gethook(thread) end
5770
--- with a name for the current function, if a reasonable name can be found,
5871
--- and the expression `debug.getinfo(print)` returns a table with all available
5972
--- information about the `print` function.
60-
---@overload fun(f:table):table
73+
---@overload fun(f:function):DebugInfo
6174
---@param thread thread
62-
---@param f table
75+
---@param f function
6376
---@param what string
64-
---@return table
77+
---@return DebugInfo
6578
function debug.getinfo(thread, f, what) end
6679

6780
---
@@ -124,7 +137,7 @@ function debug.getupvalue(f, up) end
124137
--- call `getinfo` with level 2 to get more information about the running
125138
--- function (level 0 is the `getinfo` function, and level 1 is the hook
126139
--- function)
127-
---@overload fun(hook:fun():any, mask:any)
140+
---@overload fun(hook:(fun():any), mask:any):void
128141
---@param thread thread
129142
---@param hook fun():any
130143
---@param mask string

src/main/resources/std/Lua51/debug.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ function debug.getfenv(o) end
3737
---@return thread
3838
function debug.gethook(thread) end
3939

40+
---@class DebugInfo
41+
---@field linedefined number
42+
---@field lastlinedefined number
43+
---@field currentline number
44+
---@field func function
45+
---@field isvararg boolean
46+
---@field namewhat string
47+
---@field source string
48+
---@field nups number
49+
---@field what string
50+
---@field nparams number
51+
---@field short_src string
52+
4053
---
4154
--- Returns a table with information about a function. You can give the
4255
--- function directly, or you can give a number as the value of `f`,
@@ -57,11 +70,11 @@ function debug.gethook(thread) end
5770
--- with a name for the current function, if a reasonable name can be found,
5871
--- and the expression `debug.getinfo(print)` returns a table with all available
5972
--- information about the `print` function.
60-
---@overload fun(f:table):table
73+
---@overload fun(f:function):DebugInfo
6174
---@param thread thread
62-
---@param f table
75+
---@param f function
6376
---@param what string
64-
---@return table
77+
---@return DebugInfo
6578
function debug.getinfo(thread, f, what) end
6679

6780
---

src/main/resources/std/Lua52/debug.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ function debug.debug() end
3434
---@return thread
3535
function debug.gethook(thread) end
3636

37+
---@class DebugInfo
38+
---@field linedefined number
39+
---@field lastlinedefined number
40+
---@field currentline number
41+
---@field func function
42+
---@field isvararg boolean
43+
---@field namewhat string
44+
---@field source string
45+
---@field nups number
46+
---@field what string
47+
---@field nparams number
48+
---@field short_src string
49+
3750
---
3851
--- Returns a table with information about a function. You can give the
3952
--- function directly, or you can give a number as the value of `f`,
@@ -54,11 +67,11 @@ function debug.gethook(thread) end
5467
--- with a name for the current function, if a reasonable name can be found,
5568
--- and the expression `debug.getinfo(print)` returns a table with all available
5669
--- information about the `print` function.
57-
---@overload fun(f:table):table
70+
---@overload fun(f:function):DebugInfo
5871
---@param thread thread
59-
---@param f table
72+
---@param f function
6073
---@param what string
61-
---@return table
74+
---@return DebugInfo
6275
function debug.getinfo(thread, f, what) end
6376

6477
---

src/main/resources/std/Lua53/debug.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ function debug.debug() end
3434
---@return thread
3535
function debug.gethook(thread) end
3636

37+
---@class DebugInfo
38+
---@field linedefined number
39+
---@field lastlinedefined number
40+
---@field currentline number
41+
---@field func function
42+
---@field isvararg boolean
43+
---@field namewhat string
44+
---@field source string
45+
---@field nups number
46+
---@field what string
47+
---@field nparams number
48+
---@field short_src string
49+
3750
---
3851
--- Returns a table with information about a function. You can give the
3952
--- function directly, or you can give a number as the value of `f`,
@@ -54,11 +67,11 @@ function debug.gethook(thread) end
5467
--- with a name for the current function, if a reasonable name can be found,
5568
--- and the expression `debug.getinfo(print)` returns a table with all available
5669
--- information about the `print` function.
57-
---@overload fun(f:table):table
70+
---@overload fun(f:function):DebugInfo
5871
---@param thread thread
59-
---@param f table
72+
---@param f function
6073
---@param what string
61-
---@return table
74+
---@return DebugInfo
6275
function debug.getinfo(thread, f, what) end
6376

6477
---

src/main/resources/std/Lua54/debug.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ function debug.debug() end
3434
---@return thread
3535
function debug.gethook(thread) end
3636

37+
---@class DebugInfo
38+
---@field linedefined number
39+
---@field lastlinedefined number
40+
---@field currentline number
41+
---@field func function
42+
---@field isvararg boolean
43+
---@field namewhat string
44+
---@field source string
45+
---@field nups number
46+
---@field what string
47+
---@field nparams number
48+
---@field short_src string
49+
3750
---
3851
--- Returns a table with information about a function. You can give the
3952
--- function directly, or you can give a number as the value of `f`,
@@ -54,11 +67,11 @@ function debug.gethook(thread) end
5467
--- with a name for the current function, if a reasonable name can be found,
5568
--- and the expression `debug.getinfo(print)` returns a table with all available
5669
--- information about the `print` function.
57-
---@overload fun(f:table):table
70+
---@overload fun(f:function):DebugInfo
5871
---@param thread thread
59-
---@param f table
72+
---@param f function
6073
---@param what string
61-
---@return table
74+
---@return DebugInfo
6275
function debug.getinfo(thread, f, what) end
6376

6477
---

0 commit comments

Comments
 (0)