Skip to content

Commit e3fdec6

Browse files
committed
fix lua_filesystem
1 parent ccd2ae5 commit e3fdec6

File tree

23 files changed

+3320
-59
lines changed

23 files changed

+3320
-59
lines changed

resources/meta/Lua 5.4 en-us utf8/basic.lua

Lines changed: 454 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---@meta bit
2+
3+
---@version JIT
4+
---@class bitlib
5+
bit = {}
6+
7+
---@param x integer
8+
---@return integer y
9+
---@nodiscard
10+
function bit.tobit(x) end
11+
12+
---@param x integer
13+
---@param n? integer
14+
---@return string y
15+
---@nodiscard
16+
function bit.tohex(x, n) end
17+
18+
---@param x integer
19+
---@return integer y
20+
---@nodiscard
21+
function bit.bnot(x) end
22+
23+
---@param x integer
24+
---@param x2 integer
25+
---@param ... integer
26+
---@return integer y
27+
---@nodiscard
28+
function bit.bor(x, x2, ...) end
29+
30+
---@param x integer
31+
---@param x2 integer
32+
---@param ... integer
33+
---@return integer y
34+
---@nodiscard
35+
function bit.band(x, x2, ...) end
36+
37+
---@param x integer
38+
---@param x2 integer
39+
---@param ... integer
40+
---@return integer y
41+
---@nodiscard
42+
function bit.bxor(x, x2, ...) end
43+
44+
---@param x integer
45+
---@param n integer
46+
---@return integer y
47+
---@nodiscard
48+
function bit.lshift(x, n) end
49+
50+
---@param x integer
51+
---@param n integer
52+
---@return integer y
53+
---@nodiscard
54+
function bit.rshift(x, n) end
55+
56+
---@param x integer
57+
---@param n integer
58+
---@return integer y
59+
---@nodiscard
60+
function bit.arshift(x, n) end
61+
62+
---@param x integer
63+
---@param n integer
64+
---@return integer y
65+
---@nodiscard
66+
function bit.rol(x, n) end
67+
68+
---@param x integer
69+
---@param n integer
70+
---@return integer y
71+
---@nodiscard
72+
function bit.ror(x, n) end
73+
74+
---@param x integer
75+
---@return integer y
76+
---@nodiscard
77+
function bit.bswap(x) end
78+
79+
return bit
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
---@meta bit32
2+
3+
---@version 5.2
4+
---
5+
---
6+
---
7+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32"])
8+
---
9+
---@class bit32lib
10+
bit32 = {}
11+
12+
---
13+
---Returns the number `x` shifted `disp` bits to the right. Negative displacements shift to the left.
14+
---
15+
---This shift operation is what is called arithmetic shift. Vacant bits on the left are filled with copies of the higher bit of `x`; vacant bits on the right are filled with zeros.
16+
---
17+
---
18+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.arshift"])
19+
---
20+
---@param x integer
21+
---@param disp integer
22+
---@return integer
23+
---@nodiscard
24+
function bit32.arshift(x, disp) end
25+
26+
---
27+
---Returns the bitwise *and* of its operands.
28+
---
29+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.band"])
30+
---
31+
---@return integer
32+
---@nodiscard
33+
function bit32.band(...) end
34+
35+
---
36+
---Returns the bitwise negation of `x`.
37+
---
38+
---```lua
39+
---assert(bit32.bnot(x) ==
40+
---(-1 - x) % 2^32)
41+
---```
42+
---
43+
---
44+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.bnot"])
45+
---
46+
---@param x integer
47+
---@return integer
48+
---@nodiscard
49+
function bit32.bnot(x) end
50+
51+
---
52+
---Returns the bitwise *or* of its operands.
53+
---
54+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.bor"])
55+
---
56+
---@return integer
57+
---@nodiscard
58+
function bit32.bor(...) end
59+
60+
---
61+
---Returns a boolean signaling whether the bitwise *and* of its operands is different from zero.
62+
---
63+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.btest"])
64+
---
65+
---@return boolean
66+
---@nodiscard
67+
function bit32.btest(...) end
68+
69+
---
70+
---Returns the bitwise *exclusive or* of its operands.
71+
---
72+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.bxor"])
73+
---
74+
---@return integer
75+
---@nodiscard
76+
function bit32.bxor(...) end
77+
78+
---
79+
---Returns the unsigned number formed by the bits `field` to `field + width - 1` from `n`.
80+
---
81+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.extract"])
82+
---
83+
---@param n integer
84+
---@param field integer
85+
---@param width? integer
86+
---@return integer
87+
---@nodiscard
88+
function bit32.extract(n, field, width) end
89+
90+
---
91+
---Returns a copy of `n` with the bits `field` to `field + width - 1` replaced by the value `v` .
92+
---
93+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.replace"])
94+
---
95+
---@param n integer
96+
---@param v integer
97+
---@param field integer
98+
---@param width? integer
99+
---@nodiscard
100+
function bit32.replace(n, v, field, width) end
101+
102+
---
103+
---Returns the number `x` rotated `disp` bits to the left. Negative displacements rotate to the right.
104+
---
105+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.lrotate"])
106+
---
107+
---@param x integer
108+
---@param distp integer
109+
---@return integer
110+
---@nodiscard
111+
function bit32.lrotate(x, distp) end
112+
113+
---
114+
---Returns the number `x` shifted `disp` bits to the left. Negative displacements shift to the right. In any direction, vacant bits are filled with zeros.
115+
---
116+
---```lua
117+
---assert(bit32.lshift(b, disp) ==
118+
---(b * 2^disp) % 2^32)
119+
---```
120+
---
121+
---
122+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.lshift"])
123+
---
124+
---@param x integer
125+
---@param distp integer
126+
---@return integer
127+
---@nodiscard
128+
function bit32.lshift(x, distp) end
129+
130+
---
131+
---Returns the number `x` rotated `disp` bits to the right. Negative displacements rotate to the left.
132+
---
133+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.rrotate"])
134+
---
135+
---@param x integer
136+
---@param distp integer
137+
---@return integer
138+
---@nodiscard
139+
function bit32.rrotate(x, distp) end
140+
141+
---
142+
---Returns the number `x` shifted `disp` bits to the right. Negative displacements shift to the left. In any direction, vacant bits are filled with zeros.
143+
---
144+
---```lua
145+
---assert(bit32.rshift(b, disp) ==
146+
---math.floor(b % 2^32 / 2^disp))
147+
---```
148+
---
149+
---
150+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-bit32.rshift"])
151+
---
152+
---@param x integer
153+
---@param distp integer
154+
---@return integer
155+
---@nodiscard
156+
function bit32.rshift(x, distp) end
157+
158+
return bit32
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---@meta _
2+
3+
---@class unknown
4+
---@class any
5+
---@class nil
6+
---@class boolean
7+
---@class true: boolean
8+
---@class false: boolean
9+
---@class number
10+
---@class integer: number
11+
---@class thread
12+
---@class table<K, V>: { [K]: V }
13+
---@class string: stringlib
14+
---@class userdata
15+
---@class lightuserdata
16+
---@class function
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---@meta coroutine
2+
3+
---
4+
---
5+
---
6+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-coroutine"])
7+
---
8+
---@class coroutinelib
9+
coroutine = {}
10+
11+
---
12+
---Creates a new coroutine, with body `f`. `f` must be a function. Returns this new coroutine, an object with type `"thread"`.
13+
---
14+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-coroutine.create"])
15+
---
16+
---@param f async fun(...):...
17+
---@return thread
18+
---@nodiscard
19+
function coroutine.create(f) end
20+
21+
---
22+
---Returns true when the coroutine `co` can yield. The default for `co` is the running coroutine.
23+
---
24+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-coroutine.isyieldable"])
25+
---
26+
---@param co? thread
27+
---@return boolean
28+
---@nodiscard
29+
function coroutine.isyieldable(co) end
30+
31+
---@version >5.4
32+
---
33+
---Closes coroutine `co` , closing all its pending to-be-closed variables and putting the coroutine in a dead state.
34+
---
35+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-coroutine.close"])
36+
---
37+
---@param co thread
38+
---@return boolean noerror
39+
---@return any errorobject
40+
function coroutine.close(co) end
41+
42+
---
43+
---Starts or continues the execution of coroutine `co`.
44+
---
45+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-coroutine.resume"])
46+
---
47+
---@param co thread
48+
---@param val1? any
49+
---@return boolean success
50+
---@return any ...
51+
function coroutine.resume(co, val1, ...) end
52+
53+
---
54+
---Returns the running coroutine plus a boolean, true when the running coroutine is the main one.
55+
---
56+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-coroutine.running"])
57+
---
58+
---@return thread running
59+
---@return boolean ismain
60+
---@nodiscard
61+
function coroutine.running() end
62+
63+
---
64+
---Returns the status of coroutine `co`.
65+
---
66+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-coroutine.status"])
67+
---
68+
---@param co thread
69+
---@return
70+
---| '"running"' # Is running.
71+
---| '"suspended"' # Is suspended or not started.
72+
---| '"normal"' # Is active but not running.
73+
---| '"dead"' # Has finished or stopped with an error.
74+
---@nodiscard
75+
function coroutine.status(co) end
76+
77+
---
78+
---Creates a new coroutine, with body `f`; `f` must be a function. Returns a function that resumes the coroutine each time it is called.
79+
---
80+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-coroutine.wrap"])
81+
---
82+
---@param f async fun(...):...
83+
---@return fun(...):...
84+
---@nodiscard
85+
function coroutine.wrap(f) end
86+
87+
---
88+
---Suspends the execution of the calling coroutine.
89+
---
90+
---[View documents](command:extension.lua.doc?["en-us/54/manual.html/pdf-coroutine.yield"])
91+
---
92+
---@async
93+
---@return any ...
94+
function coroutine.yield(...) end
95+
96+
return coroutine

0 commit comments

Comments
 (0)