Skip to content

Commit f48ff78

Browse files
authored
Merge pull request #1308 from fesily/luajit-buildin-table.new-and-table.clear
table new/clear function actual use scenarios
2 parents fd6b84b + 1d97909 commit f48ff78

File tree

4 files changed

+37
-27
lines changed

4 files changed

+37
-27
lines changed

meta/template/table.clear.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---#if not JIT then DISABLE() end
2+
---@meta
3+
4+
---@version JIT
5+
---#DES 'table.clear'
6+
---@param tab table
7+
local function clear(tab) end
8+
9+
return clear

meta/template/table.lua

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,4 @@ function table.foreachi(list, callback) end
9292
---@deprecated
9393
function table.getn(list) end
9494

95-
---@version JIT
96-
---#DES 'table.new'
97-
---@param narray integer
98-
---@param nhash integer
99-
---@return table
100-
function table.new(narray, nhash) end
101-
102-
---@version JIT
103-
---#DES 'table.clear'
104-
---@param tab table
105-
function table.clear(tab) end
106-
10795
return table

meta/template/table.new.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---#if not JIT then DISABLE() end
2+
---@meta
3+
4+
---@version JIT
5+
---#DES 'table.new'
6+
---@param narray integer
7+
---@param nhash integer
8+
---@return table
9+
local function new(narray, nhash) end
10+
11+
return new

script/proto/define.lua

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,23 @@ m.TokenTypes = {
165165
}
166166

167167
m.BuiltIn = {
168-
['basic'] = 'default',
169-
['bit'] = 'default',
170-
['bit32'] = 'default',
171-
['builtin'] = 'default',
172-
['coroutine'] = 'default',
173-
['debug'] = 'default',
174-
['ffi'] = 'default',
175-
['io'] = 'default',
176-
['jit'] = 'default',
177-
['math'] = 'default',
178-
['os'] = 'default',
179-
['package'] = 'default',
180-
['string'] = 'default',
181-
['table'] = 'default',
182-
['utf8'] = 'default',
168+
['basic'] = 'default',
169+
['bit'] = 'default',
170+
['bit32'] = 'default',
171+
['builtin'] = 'default',
172+
['coroutine'] = 'default',
173+
['debug'] = 'default',
174+
['ffi'] = 'default',
175+
['io'] = 'default',
176+
['jit'] = 'default',
177+
['math'] = 'default',
178+
['os'] = 'default',
179+
['package'] = 'default',
180+
['string'] = 'default',
181+
['table'] = 'default',
182+
['table.new'] = 'default',
183+
['table.clear'] = 'default',
184+
['utf8'] = 'default',
183185
}
184186

185187
m.InlayHintKind = {

0 commit comments

Comments
 (0)