@enjoys/context-engine 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,181 +1,931 @@
1
1
  {
2
2
  "language": "lua",
3
3
  "definitions": {
4
+ "print": {
5
+ "signature": "print(···)",
6
+ "description": "Receives any number of arguments and prints their values to stdout, converting each with tostring. Values are tab-separated with a trailing newline.",
7
+ "type": "function",
8
+ "module": "global"
9
+ },
10
+ "type": {
11
+ "signature": "type(v) -> string",
12
+ "description": "Returns the type of its only argument, coded as a string: \"nil\", \"number\", \"string\", \"boolean\", \"table\", \"function\", \"thread\", or \"userdata\".",
13
+ "type": "function",
14
+ "module": "global"
15
+ },
16
+ "tostring": {
17
+ "signature": "tostring(v) -> string",
18
+ "description": "Converts any value to a string. If the metatable has a __tostring metamethod, calls it.",
19
+ "type": "function",
20
+ "module": "global"
21
+ },
22
+ "tonumber": {
23
+ "signature": "tonumber(e [, base]) -> number | nil",
24
+ "description": "Converts its argument to a number. An optional base (2–36) interprets the string in that base. Returns nil if conversion fails.",
25
+ "type": "function",
26
+ "module": "global"
27
+ },
28
+ "pairs": {
29
+ "signature": "pairs(t) -> function, table, nil",
30
+ "description": "Returns the next function, the table t, and nil, enabling iteration over all key–value pairs with a generic for.",
31
+ "type": "function",
32
+ "module": "global"
33
+ },
34
+ "ipairs": {
35
+ "signature": "ipairs(t) -> function, table, 0",
36
+ "description": "Returns an iterator for integer keys 1, 2, … until a nil value is found. Suitable for arrays/sequences.",
37
+ "type": "function",
38
+ "module": "global"
39
+ },
40
+ "next": {
41
+ "signature": "next(table [, index]) -> key, value | nil",
42
+ "description": "Returns the next index of the table and its associated value. When called with nil as the second argument, returns an initial index and value.",
43
+ "type": "function",
44
+ "module": "global"
45
+ },
46
+ "select": {
47
+ "signature": "select(index, ···) -> ...",
48
+ "description": "If index is a number, returns all arguments after that position. If index is \"#\", returns the total argument count.",
49
+ "type": "function",
50
+ "module": "global"
51
+ },
52
+ "rawget": {
53
+ "signature": "rawget(table, index) -> any",
54
+ "description": "Gets table[index] without invoking the __index metamethod.",
55
+ "type": "function",
56
+ "module": "global"
57
+ },
58
+ "rawset": {
59
+ "signature": "rawset(table, index, value) -> table",
60
+ "description": "Sets table[index] = value without invoking the __newindex metamethod.",
61
+ "type": "function",
62
+ "module": "global"
63
+ },
64
+ "rawequal": {
65
+ "signature": "rawequal(v1, v2) -> boolean",
66
+ "description": "Checks whether v1 equals v2 without invoking the __eq metamethod.",
67
+ "type": "function",
68
+ "module": "global"
69
+ },
70
+ "rawlen": {
71
+ "signature": "rawlen(v) -> integer",
72
+ "description": "Returns the length of a table or string without invoking the __len metamethod. Available in Lua 5.2+.",
73
+ "type": "function",
74
+ "module": "global"
75
+ },
76
+ "setmetatable": {
77
+ "signature": "setmetatable(table, metatable) -> table",
78
+ "description": "Sets the metatable for the given table. If metatable is nil, removes the metatable. If the original metatable has a __metatable field, raises an error.",
79
+ "type": "function",
80
+ "module": "global"
81
+ },
82
+ "getmetatable": {
83
+ "signature": "getmetatable(object) -> table | nil | any",
84
+ "description": "Returns the metatable of the object. If the metatable has a __metatable field, returns that value instead.",
85
+ "type": "function",
86
+ "module": "global"
87
+ },
88
+ "require": {
89
+ "signature": "require(modname) -> any",
90
+ "description": "Loads the given module. Checks package.loaded first, then searches using package.searchers (5.2+) or package.loaders (5.1). Caches the result.",
91
+ "type": "function",
92
+ "module": "global"
93
+ },
94
+ "dofile": {
95
+ "signature": "dofile([filename]) -> ...",
96
+ "description": "Opens the named file and executes its contents as a Lua chunk. Returns values returned by the chunk. Without arguments, executes stdin.",
97
+ "type": "function",
98
+ "module": "global"
99
+ },
100
+ "loadfile": {
101
+ "signature": "loadfile([filename [, mode [, env]]]) -> function | nil, string",
102
+ "description": "Loads a file as a Lua chunk without executing it. Returns the compiled chunk as a function, or nil plus an error message.",
103
+ "type": "function",
104
+ "module": "global"
105
+ },
106
+ "load": {
107
+ "signature": "load(chunk [, chunkname [, mode [, env]]]) -> function | nil, string",
108
+ "description": "Loads a chunk from a string or function. Returns the compiled chunk as a function, or nil plus an error message.",
109
+ "type": "function",
110
+ "module": "global"
111
+ },
112
+ "pcall": {
113
+ "signature": "pcall(f [, arg1, ···]) -> boolean, ...",
114
+ "description": "Calls function f in protected mode. Returns true plus results on success, false plus the error object on failure.",
115
+ "type": "function",
116
+ "module": "global"
117
+ },
118
+ "xpcall": {
119
+ "signature": "xpcall(f, msgh [, arg1, ···]) -> boolean, ...",
120
+ "description": "Like pcall but sets the message handler msgh for error handling. Extra arguments to f supported in Lua 5.2+ and LuaJIT 2.1.",
121
+ "type": "function",
122
+ "module": "global"
123
+ },
124
+ "error": {
125
+ "signature": "error(message [, level])",
126
+ "description": "Raises an error with the given message. Level controls the error position: 1 (default) = where error was called, 2 = caller, 0 = no position.",
127
+ "type": "function",
128
+ "module": "global"
129
+ },
130
+ "assert": {
131
+ "signature": "assert(v [, message]) -> v, message",
132
+ "description": "Calls error if v is false or nil; otherwise returns all its arguments. Default message is \"assertion failed!\".",
133
+ "type": "function",
134
+ "module": "global"
135
+ },
136
+ "collectgarbage": {
137
+ "signature": "collectgarbage([opt [, arg]]) -> varies",
138
+ "description": "Generic interface to the garbage collector. Options include \"collect\", \"stop\", \"restart\", \"count\", \"step\", \"isrunning\", \"incremental\" (5.4), \"generational\" (5.4).",
139
+ "type": "function",
140
+ "module": "global"
141
+ },
142
+ "unpack": {
143
+ "signature": "unpack(list [, i [, j]]) -> ...",
144
+ "description": "Returns the elements from the given list. In Lua 5.2+ this is table.unpack. default i is 1, j is #list.",
145
+ "type": "function",
146
+ "module": "global"
147
+ },
148
+ "warn": {
149
+ "signature": "warn(msg1 [, msg2, ···])",
150
+ "description": "Emits a warning with the given message segments. If the first segment starts with \"@\", it controls warnings: \"@on\" / \"@off\". Available in Lua 5.4+.",
151
+ "type": "function",
152
+ "module": "global"
153
+ },
154
+ "_G": {
155
+ "signature": "_G",
156
+ "description": "A global variable holding a reference to the global environment table. In Lua 5.2+, just a regular global containing the global table.",
157
+ "type": "variable",
158
+ "module": "global"
159
+ },
160
+ "_ENV": {
161
+ "signature": "_ENV",
162
+ "description": "The environment table for the current chunk (Lua 5.2+). Free names are syntactic sugar for _ENV.name. Changing _ENV changes visible globals.",
163
+ "type": "variable",
164
+ "module": "global"
165
+ },
166
+ "_VERSION": {
167
+ "signature": "_VERSION",
168
+ "description": "A global string containing the running Lua version, e.g. \"Lua 5.4\".",
169
+ "type": "variable",
170
+ "module": "global"
171
+ },
172
+ "loadstring": {
173
+ "signature": "loadstring(string [, chunkname]) -> function | nil, string",
174
+ "description": "Loads a string as a Lua chunk (Lua 5.1). In Lua 5.2+ use load() instead.",
175
+ "type": "function",
176
+ "module": "global"
177
+ },
178
+ "module": {
179
+ "signature": "module(name [, ···])",
180
+ "description": "Creates a module (Lua 5.1). Deprecated in Lua 5.2+ in favor of the return-a-table pattern.",
181
+ "type": "function",
182
+ "module": "global"
183
+ },
4
184
  "string": {
5
185
  "signature": "string library",
6
- "description": "The string library provides generic functions for string manipulation, such as finding and extracting substrings and pattern matching. In Lua, strings are indexed starting at 1 and can contain embedded zeros. Negative indices count from the end of the string.",
186
+ "description": "Provides generic string manipulation functions. Strings in Lua are indexed starting at 1, are immutable, and can contain embedded zeros.",
7
187
  "type": "module",
8
188
  "module": "string",
9
189
  "members": {
10
- "format": { "signature": "string.format(formatstring, ···)", "description": "Returns a formatted version of its variable number of arguments following the description given in formatstring. Similar to the ISO C function sprintf. Supports format specifiers: %d, %i, %u, %f, %e, %g, %x, %o, %s, %q, %c, and %%.", "type": "function" },
11
- "find": { "signature": "string.find(s, pattern [, init [, plain]])", "description": "Looks for the first match of pattern in the string s. If found, returns the indices of s where the match starts and ends; otherwise returns nil. If pattern has captures, the captured values are also returned. The optional init specifies where to start the search (default 1). If plain is true, pattern matching is turned off.", "type": "function" },
12
- "match": { "signature": "string.match(s, pattern [, init])", "description": "Looks for the first match of pattern in the string s. If found, returns the captures from the pattern; otherwise returns nil. If pattern specifies no captures, the whole match is returned.", "type": "function" },
13
- "gmatch": { "signature": "string.gmatch(s, pattern)", "description": "Returns an iterator function that, each time it is called, returns the next captures from pattern over the string s. If pattern has no captures, the whole match is produced in each call. In Lua 5.4, an optional init argument specifies where to start.", "type": "function" },
14
- "gsub": { "signature": "string.gsub(s, pattern, repl [, n])", "description": "Returns a copy of s in which all (or the first n) occurrences of the pattern have been replaced by a replacement string/table/function repl. Also returns the total number of matches as a second value.", "type": "function" },
15
- "sub": { "signature": "string.sub(s, i [, j])", "description": "Returns the substring of s that starts at i and continues until j (inclusive). i and j can be negative, counting from the end. Default j is -1 (end of string).", "type": "function" },
16
- "rep": { "signature": "string.rep(s, n [, sep])", "description": "Returns a string that is the concatenation of n copies of the string s separated by the string sep. The default value for sep is the empty string. Available since Lua 5.2 for the sep parameter.", "type": "function" },
17
- "reverse": { "signature": "string.reverse(s)", "description": "Returns a string that is the string s reversed.", "type": "function" },
18
- "upper": { "signature": "string.upper(s)", "description": "Returns a copy of s with all lowercase letters changed to uppercase. The definition of what a lowercase letter is depends on the current locale.", "type": "function" },
19
- "lower": { "signature": "string.lower(s)", "description": "Returns a copy of s with all uppercase letters changed to lowercase. The definition of what an uppercase letter is depends on the current locale.", "type": "function" },
20
- "len": { "signature": "string.len(s)", "description": "Returns the length of the string s. The empty string has length 0. Embedded zeros are counted, so \"a\\000bc\\000\" has length 5.", "type": "function" },
21
- "byte": { "signature": "string.byte(s [, i [, j]])", "description": "Returns the internal numeric codes of the characters s[i], s[i+1], ..., s[j]. The default value for i is 1; the default value for j is i.", "type": "function" },
22
- "char": { "signature": "string.char(···)", "description": "Receives zero or more integers. Returns a string with length equal to the number of arguments, in which each character has the internal numeric code equal to its corresponding argument.", "type": "function" },
23
- "dump": { "signature": "string.dump(function [, strip])", "description": "Returns a string containing a binary representation of the given function, so that a later load on this string returns a copy of the function. In Lua 5.3+, if strip is true, the binary representation may not include debug information.", "type": "function" }
190
+ "format": {
191
+ "signature": "string.format(formatstring, ···)",
192
+ "description": "Returns a formatted version of its arguments following the format description, similar to C sprintf. Supports %d, %i, %u, %f, %e, %g, %x, %o, %s, %q, %c, and %%.",
193
+ "type": "function"
194
+ },
195
+ "find": {
196
+ "signature": "string.find(s, pattern [, init [, plain]])",
197
+ "description": "Looks for the first match of pattern in s. Returns start and end indices, and any captures. If plain is true, pattern matching is off.",
198
+ "type": "function"
199
+ },
200
+ "match": {
201
+ "signature": "string.match(s, pattern [, init])",
202
+ "description": "Returns the captures from the first match of pattern in s or nil. If no captures, returns the whole match.",
203
+ "type": "function"
204
+ },
205
+ "gmatch": {
206
+ "signature": "string.gmatch(s, pattern [, init])",
207
+ "description": "Returns an iterator that produces the successive captures from pattern over s. Lua 5.4 added the optional init parameter.",
208
+ "type": "function"
209
+ },
210
+ "gsub": {
211
+ "signature": "string.gsub(s, pattern, repl [, n])",
212
+ "description": "Returns a copy of s with all (or first n) occurrences of pattern replaced by repl (string, table, or function). Also returns total match count.",
213
+ "type": "function"
214
+ },
215
+ "sub": {
216
+ "signature": "string.sub(s, i [, j])",
217
+ "description": "Returns the substring from position i to j (inclusive). Negative indices count from the end. Default j is -1.",
218
+ "type": "function"
219
+ },
220
+ "rep": {
221
+ "signature": "string.rep(s, n [, sep])",
222
+ "description": "Returns n copies of s concatenated, separated by sep (default empty). The sep parameter available since Lua 5.2.",
223
+ "type": "function"
224
+ },
225
+ "reverse": {
226
+ "signature": "string.reverse(s)",
227
+ "description": "Returns the string s reversed.",
228
+ "type": "function"
229
+ },
230
+ "upper": {
231
+ "signature": "string.upper(s)",
232
+ "description": "Returns a copy of s with all lowercase letters changed to uppercase.",
233
+ "type": "function"
234
+ },
235
+ "lower": {
236
+ "signature": "string.lower(s)",
237
+ "description": "Returns a copy of s with all uppercase letters changed to lowercase.",
238
+ "type": "function"
239
+ },
240
+ "len": {
241
+ "signature": "string.len(s)",
242
+ "description": "Returns the length of the string s. Embedded zeros are counted.",
243
+ "type": "function"
244
+ },
245
+ "byte": {
246
+ "signature": "string.byte(s [, i [, j]])",
247
+ "description": "Returns the internal numeric codes of characters s[i] through s[j]. Defaults: i=1, j=i.",
248
+ "type": "function"
249
+ },
250
+ "char": {
251
+ "signature": "string.char(···)",
252
+ "description": "Returns a string with each character having the numeric code of the corresponding argument.",
253
+ "type": "function"
254
+ },
255
+ "dump": {
256
+ "signature": "string.dump(function [, strip])",
257
+ "description": "Returns a binary representation of the given function. If strip is true (5.3+), excludes debug info.",
258
+ "type": "function"
259
+ },
260
+ "pack": {
261
+ "signature": "string.pack(fmt, v1, v2, ···)",
262
+ "description": "Returns a binary string containing the values packed according to the format string fmt. Available in Lua 5.3+.",
263
+ "type": "function"
264
+ },
265
+ "unpack": {
266
+ "signature": "string.unpack(fmt, s [, pos])",
267
+ "description": "Returns the values packed in string s according to fmt. Also returns the position after the last read byte. Lua 5.3+.",
268
+ "type": "function"
269
+ },
270
+ "packsize": {
271
+ "signature": "string.packsize(fmt)",
272
+ "description": "Returns the size of a string resulting from string.pack with the given format, without variable-length options. Lua 5.3+.",
273
+ "type": "function"
274
+ }
24
275
  }
25
276
  },
26
277
  "table": {
27
278
  "signature": "table library",
28
- "description": "The table library provides generic functions for table manipulation. It provides its functions as fields of the global table `table`. Most functions assume the table represents a list/array (integer keys from 1 to a given n).",
279
+ "description": "Provides generic functions for table manipulation. Most functions assume the table represents a list/array with integer keys from 1 to n.",
29
280
  "type": "module",
30
281
  "module": "table",
31
282
  "members": {
32
- "insert": { "signature": "table.insert(list, [pos,] value)", "description": "Inserts element value at position pos in list, shifting up the elements list[pos], list[pos+1], ..., list[#list]. The default value for pos is #list+1, so a call table.insert(t, x) inserts x at the end of list t.", "type": "function" },
33
- "remove": { "signature": "table.remove(list [, pos])", "description": "Removes from list the element at position pos, returning the value of the removed element. The default value for pos is #list, so that a call table.remove(l) removes the last element.", "type": "function" },
34
- "sort": { "signature": "table.sort(list [, comp])", "description": "Sorts the list elements in a given order, in-place, from list[1] to list[#list]. If comp is given, it must be a function that receives two list elements and returns true when the first element must come before the second. Uses an introsort algorithm (Lua 5.4).", "type": "function" },
35
- "concat": { "signature": "table.concat(list [, sep [, i [, j]]])", "description": "Given a list where all elements are strings or numbers, returns the string list[i]..sep..list[i+1]..sep..list[j]. The default value for sep is the empty string, for i is 1, and for j is #list.", "type": "function" },
36
- "move": { "signature": "table.move(a1, f, e, t [, a2])", "description": "Moves elements from one position to another in a table (or between tables). Copies elements a1[f]..a1[e] into a2[t]..a2[t+e-f]. The default for a2 is a1. Available in Lua 5.3+.", "type": "function" },
37
- "pack": { "signature": "table.pack(···)", "description": "Returns a new table with all arguments stored into keys 1, 2, etc., and with a field 'n' with the total number of arguments. Available in Lua 5.2+.", "type": "function" },
38
- "unpack": { "signature": "table.unpack(list [, i [, j]])", "description": "Returns the elements from the given list. This function is equivalent to: return list[i], list[i+1], ···, list[j]. By default, i is 1 and j is #list. In Lua 5.1, this is the global function unpack.", "type": "function" }
283
+ "insert": {
284
+ "signature": "table.insert(list, [pos,] value)",
285
+ "description": "Inserts value at position pos (default #list+1), shifting subsequent elements up.",
286
+ "type": "function"
287
+ },
288
+ "remove": {
289
+ "signature": "table.remove(list [, pos])",
290
+ "description": "Removes and returns the element at position pos (default #list), shifting subsequent elements down.",
291
+ "type": "function"
292
+ },
293
+ "sort": {
294
+ "signature": "table.sort(list [, comp])",
295
+ "description": "Sorts list elements in-place. If comp is given, it must return true when the first element should come before the second.",
296
+ "type": "function"
297
+ },
298
+ "concat": {
299
+ "signature": "table.concat(list [, sep [, i [, j]]])",
300
+ "description": "Returns the concatenation of list[i]..sep..list[i+1]..sep..list[j]. Default sep is empty string, i=1, j=#list.",
301
+ "type": "function"
302
+ },
303
+ "move": {
304
+ "signature": "table.move(a1, f, e, t [, a2])",
305
+ "description": "Copies elements a1[f]..a1[e] into a2[t]..a2[t+e-f]. Default a2 is a1. Available in Lua 5.3+.",
306
+ "type": "function"
307
+ },
308
+ "pack": {
309
+ "signature": "table.pack(···)",
310
+ "description": "Returns a new table with all arguments stored into keys 1, 2, etc., and a field 'n' with the total count. Lua 5.2+.",
311
+ "type": "function"
312
+ },
313
+ "unpack": {
314
+ "signature": "table.unpack(list [, i [, j]])",
315
+ "description": "Returns the elements from the given list. Equivalent to return list[i], ..., list[j]. Lua 5.2+ (global unpack in 5.1).",
316
+ "type": "function"
317
+ }
39
318
  }
40
319
  },
41
320
  "math": {
42
321
  "signature": "math library",
43
- "description": "The math library provides standard mathematical functions. It provides its functions and constants inside the table `math`. Functions with the annotation 'integer/float' give integer results for integer arguments and float results for float arguments (Lua 5.3+).",
322
+ "description": "Provides standard mathematical functions and constants. In Lua 5.3+, functions with annotation 'integer/float' give integer results for integer arguments.",
44
323
  "type": "module",
45
324
  "module": "math",
46
325
  "members": {
47
- "abs": { "signature": "math.abs(x)", "description": "Returns the absolute value of x. (integer/float)", "type": "function" },
48
- "ceil": { "signature": "math.ceil(x)", "description": "Returns the smallest integral value greater than or equal to x.", "type": "function" },
49
- "floor": { "signature": "math.floor(x)", "description": "Returns the largest integral value less than or equal to x.", "type": "function" },
50
- "max": { "signature": "math.max(x, ···)", "description": "Returns the argument with the maximum value, according to the Lua operator <.", "type": "function" },
51
- "min": { "signature": "math.min(x, ···)", "description": "Returns the argument with the minimum value, according to the Lua operator <.", "type": "function" },
52
- "sqrt": { "signature": "math.sqrt(x)", "description": "Returns the square root of x. You can also use the expression x^0.5 to compute this value.", "type": "function" },
53
- "random": { "signature": "math.random([m [, n]])", "description": "When called without arguments, returns a pseudo-random float in [0,1). When called with integer m, returns a pseudo-random integer in [1, m]. When called with m and n, returns a pseudo-random integer in [m, n]. Lua 5.4 uses xoshiro256** algorithm.", "type": "function" },
54
- "randomseed": { "signature": "math.randomseed([x [, y]])", "description": "Sets x (and y) as seed for the pseudo-random generator. In Lua 5.4, when called with no arguments, Lua generates a seed with a reasonable amount of randomness.", "type": "function" },
55
- "huge": { "signature": "math.huge", "description": "The float value HUGE_VAL, a value greater than any other numeric value (positive infinity).", "type": "constant" },
56
- "pi": { "signature": "math.pi", "description": "The value of π (3.14159265358979323846...).", "type": "constant" },
57
- "maxinteger": { "signature": "math.maxinteger", "description": "An integer with the maximum value for an integer. Available in Lua 5.3+.", "type": "constant" },
58
- "mininteger": { "signature": "math.mininteger", "description": "An integer with the minimum value for an integer. Available in Lua 5.3+.", "type": "constant" },
59
- "sin": { "signature": "math.sin(x)", "description": "Returns the sine of x (assumed to be in radians).", "type": "function" },
60
- "cos": { "signature": "math.cos(x)", "description": "Returns the cosine of x (assumed to be in radians).", "type": "function" },
61
- "tan": { "signature": "math.tan(x)", "description": "Returns the tangent of x (assumed to be in radians).", "type": "function" },
62
- "asin": { "signature": "math.asin(x)", "description": "Returns the arc sine of x (in radians).", "type": "function" },
63
- "acos": { "signature": "math.acos(x)", "description": "Returns the arc cosine of x (in radians).", "type": "function" },
64
- "atan": { "signature": "math.atan(y [, x])", "description": "Returns the arc tangent of y/x (in radians). Uses the signs of both arguments to find the quadrant. In Lua 5.3+, replaced math.atan2.", "type": "function" },
65
- "log": { "signature": "math.log(x [, base])", "description": "Returns the logarithm of x in the given base. The default for base is e (natural logarithm). The base parameter is available in Lua 5.2+; use math.log10 for base-10 in Lua 5.1.", "type": "function" },
66
- "exp": { "signature": "math.exp(x)", "description": "Returns the value e^x (where e is the base of natural logarithms).", "type": "function" },
67
- "fmod": { "signature": "math.fmod(x, y)", "description": "Returns the remainder of the division of x by y that rounds the quotient towards zero. (integer/float)", "type": "function" },
68
- "tointeger": { "signature": "math.tointeger(x)", "description": "If the value x is representable as a Lua integer, returns an integer with that value. Otherwise, returns nil. Available in Lua 5.3+.", "type": "function" },
69
- "type": { "signature": "math.type(x)", "description": "Returns 'integer' if x is an integer, 'float' if it is a float, or nil if x is not a number. Available in Lua 5.3+.", "type": "function" }
326
+ "abs": {
327
+ "signature": "math.abs(x)",
328
+ "description": "Returns the absolute value of x. (integer/float)",
329
+ "type": "function"
330
+ },
331
+ "ceil": {
332
+ "signature": "math.ceil(x)",
333
+ "description": "Returns the smallest integral value greater than or equal to x.",
334
+ "type": "function"
335
+ },
336
+ "floor": {
337
+ "signature": "math.floor(x)",
338
+ "description": "Returns the largest integral value less than or equal to x.",
339
+ "type": "function"
340
+ },
341
+ "sqrt": {
342
+ "signature": "math.sqrt(x)",
343
+ "description": "Returns the square root of x.",
344
+ "type": "function"
345
+ },
346
+ "sin": {
347
+ "signature": "math.sin(x)",
348
+ "description": "Returns the sine of x (in radians).",
349
+ "type": "function"
350
+ },
351
+ "cos": {
352
+ "signature": "math.cos(x)",
353
+ "description": "Returns the cosine of x (in radians).",
354
+ "type": "function"
355
+ },
356
+ "tan": {
357
+ "signature": "math.tan(x)",
358
+ "description": "Returns the tangent of x (in radians).",
359
+ "type": "function"
360
+ },
361
+ "asin": {
362
+ "signature": "math.asin(x)",
363
+ "description": "Returns the arc sine of x (in radians).",
364
+ "type": "function"
365
+ },
366
+ "acos": {
367
+ "signature": "math.acos(x)",
368
+ "description": "Returns the arc cosine of x (in radians).",
369
+ "type": "function"
370
+ },
371
+ "atan": {
372
+ "signature": "math.atan(y [, x])",
373
+ "description": "Returns the arc tangent of y/x (in radians). In Lua 5.3+, replaced math.atan2.",
374
+ "type": "function"
375
+ },
376
+ "exp": {
377
+ "signature": "math.exp(x)",
378
+ "description": "Returns e^x.",
379
+ "type": "function"
380
+ },
381
+ "log": {
382
+ "signature": "math.log(x [, base])",
383
+ "description": "Returns the logarithm of x in the given base. Default is e (natural log). The base parameter is available Lua 5.2+.",
384
+ "type": "function"
385
+ },
386
+ "max": {
387
+ "signature": "math.max(x, ···)",
388
+ "description": "Returns the argument with the maximum value.",
389
+ "type": "function"
390
+ },
391
+ "min": {
392
+ "signature": "math.min(x, ···)",
393
+ "description": "Returns the argument with the minimum value.",
394
+ "type": "function"
395
+ },
396
+ "random": {
397
+ "signature": "math.random([m [, n]])",
398
+ "description": "Returns a pseudo-random number. Without arguments: float in [0,1). With m: integer in [1,m]. With m,n: integer in [m,n]. Lua 5.4 uses xoshiro256**.",
399
+ "type": "function"
400
+ },
401
+ "randomseed": {
402
+ "signature": "math.randomseed([x [, y]])",
403
+ "description": "Sets the seed for the pseudo-random generator. In Lua 5.4, called without arguments generates a reasonable seed.",
404
+ "type": "function"
405
+ },
406
+ "fmod": {
407
+ "signature": "math.fmod(x, y)",
408
+ "description": "Returns the remainder of x/y that rounds the quotient towards zero.",
409
+ "type": "function"
410
+ },
411
+ "tointeger": {
412
+ "signature": "math.tointeger(x)",
413
+ "description": "If x is representable as a Lua integer, returns it; otherwise returns nil. Lua 5.3+.",
414
+ "type": "function"
415
+ },
416
+ "type": {
417
+ "signature": "math.type(x)",
418
+ "description": "Returns 'integer' if x is an integer, 'float' if a float, or nil if not a number. Lua 5.3+.",
419
+ "type": "function"
420
+ },
421
+ "huge": {
422
+ "signature": "math.huge",
423
+ "description": "The float value HUGE_VAL (positive infinity).",
424
+ "type": "constant"
425
+ },
426
+ "pi": {
427
+ "signature": "math.pi",
428
+ "description": "The value of π.",
429
+ "type": "constant"
430
+ },
431
+ "maxinteger": {
432
+ "signature": "math.maxinteger",
433
+ "description": "Maximum value for an integer (Lua 5.3+).",
434
+ "type": "constant"
435
+ },
436
+ "mininteger": {
437
+ "signature": "math.mininteger",
438
+ "description": "Minimum value for an integer (Lua 5.3+).",
439
+ "type": "constant"
440
+ },
441
+ "ult": {
442
+ "signature": "math.ult(m, n)",
443
+ "description": "Returns true if integer m is below integer n when compared as unsigned integers. (5.3+)"
444
+ }
70
445
  }
71
446
  },
72
447
  "io": {
73
448
  "signature": "io library",
74
- "description": "The I/O library provides two different styles for file manipulation: the first uses implicit file handles (io.read, io.write operate on default files); the second uses explicit file handles returned by io.open.",
449
+ "description": "Provides two styles for file manipulation: implicit file handles (io.read, io.write operate on default files) and explicit file handles from io.open.",
75
450
  "type": "module",
76
451
  "module": "io",
77
452
  "members": {
78
- "open": { "signature": "io.open(filename [, mode])", "description": "Opens a file in the mode specified in the string mode. Returns a new file handle, or nil plus an error message. Modes: 'r' (read, default), 'w' (write), 'a' (append), 'r+' (update read), 'w+' (update write), 'a+' (update append). Append 'b' for binary mode.", "type": "function" },
79
- "read": { "signature": "io.read(···)", "description": "Equivalent to io.input():read(···). Reads from the default input file. Formats: '*n'/'n' (number), '*a'/'a' (whole file), '*l'/'l' (line without newline, default), '*L'/'L' (line with newline). Lua 5.3+ drops the '*' prefix.", "type": "function" },
80
- "write": { "signature": "io.write(···)", "description": "Equivalent to io.output():write(···). Writes each argument to the default output file.", "type": "function" },
81
- "close": { "signature": "io.close([file])", "description": "Closes file, or the default output file if no file is given. Equivalent to file:close().", "type": "function" },
82
- "lines": { "signature": "io.lines([filename, ···])", "description": "Opens the given file name in read mode and returns an iterator function that works like file:lines(···) over the opened file. The file is closed when the loop ends. If called with no file name, uses the default input file.", "type": "function" },
83
- "input": { "signature": "io.input([file])", "description": "When called with a file name, opens the named file (in text mode) and sets its handle as the default input file. When called without arguments, returns the current default input file.", "type": "function" },
84
- "output": { "signature": "io.output([file])", "description": "When called with a file name, opens the named file (in text mode) and sets its handle as the default output file. When called without arguments, returns the current default output file.", "type": "function" },
85
- "tmpfile": { "signature": "io.tmpfile()", "description": "In case of success, returns a handle for a temporary file. This file is opened in update mode and is automatically removed when the program ends.", "type": "function" },
86
- "type": { "signature": "io.type(obj)", "description": "Checks whether obj is a valid file handle. Returns 'file' if obj is an open file handle, 'closed file' if obj is a closed file handle, or nil if obj is not a file handle.", "type": "function" },
87
- "popen": { "signature": "io.popen(prog [, mode])", "description": "Starts program prog in a separated process and returns a file handle that you can use to read data from this program (if mode is 'r', the default) or to write data to this program (if mode is 'w').", "type": "function" }
453
+ "open": {
454
+ "signature": "io.open(filename [, mode])",
455
+ "description": "Opens a file in the specified mode. Returns a file handle, or nil plus an error. Modes: 'r', 'w', 'a', 'r+', 'w+', 'a+'. Append 'b' for binary.",
456
+ "type": "function"
457
+ },
458
+ "close": {
459
+ "signature": "io.close([file])",
460
+ "description": "Closes the given file handle (or the default output file). Equivalent to file:close().",
461
+ "type": "function"
462
+ },
463
+ "read": {
464
+ "signature": "io.read(···)",
465
+ "description": "Reads from the default input file. Formats: '*n'/'n' (number), '*a'/'a' (whole file), '*l'/'l' (line, default), '*L'/'L' (line with newline).",
466
+ "type": "function"
467
+ },
468
+ "write": {
469
+ "signature": "io.write(···)",
470
+ "description": "Writes each argument to the default output file.",
471
+ "type": "function"
472
+ },
473
+ "lines": {
474
+ "signature": "io.lines([filename, ···])",
475
+ "description": "Opens the given file and returns an iterator that reads using the given formats. Closes the file when the iterator finishes.",
476
+ "type": "function"
477
+ },
478
+ "input": {
479
+ "signature": "io.input([file])",
480
+ "description": "Sets or gets the default input file. With a filename, opens and sets it. With a file handle, sets it. Without arguments, returns the current default input.",
481
+ "type": "function"
482
+ },
483
+ "output": {
484
+ "signature": "io.output([file])",
485
+ "description": "Sets or gets the default output file.",
486
+ "type": "function"
487
+ },
488
+ "flush": {
489
+ "signature": "io.flush()",
490
+ "description": "Flushes the default output file. Equivalent to io.output():flush().",
491
+ "type": "function"
492
+ },
493
+ "tmpfile": {
494
+ "signature": "io.tmpfile()",
495
+ "description": "Returns a handle for a temporary file opened in update mode. Auto-removed on program end.",
496
+ "type": "function"
497
+ },
498
+ "type": {
499
+ "signature": "io.type(obj)",
500
+ "description": "Checks whether obj is a valid file handle. Returns \"file\" for an open handle, \"closed file\" for a closed handle, or nil otherwise.",
501
+ "type": "function"
502
+ },
503
+ "stdin": {
504
+ "signature": "io.stdin",
505
+ "description": "Standard input file handle.",
506
+ "type": "field"
507
+ },
508
+ "stdout": {
509
+ "signature": "io.stdout",
510
+ "description": "Standard output file handle.",
511
+ "type": "field"
512
+ },
513
+ "stderr": {
514
+ "signature": "io.stderr",
515
+ "description": "Standard error file handle.",
516
+ "type": "field"
517
+ },
518
+ "popen": {
519
+ "signature": "io.popen(prog [, mode])",
520
+ "description": "Execute command and return file handle for pipe. mode: 'r' (read, default) or 'w' (write)."
521
+ }
88
522
  }
89
523
  },
90
524
  "os": {
91
525
  "signature": "os library",
92
- "description": "The os library provides operating system facilities. Due to the ISO C restriction, the os library offers a limited and portable set of functionality.",
526
+ "description": "Provides OS-level functions for date/time, file operations, and process control.",
93
527
  "type": "module",
94
528
  "module": "os",
95
529
  "members": {
96
- "time": { "signature": "os.time([table])", "description": "Returns the current time when called without arguments, or a time representing the local date and time specified by the given table. The table must have fields year, month, and day, and may have fields hour (default 12), min (default 0), sec (default 0), and isdst.", "type": "function" },
97
- "date": { "signature": "os.date([format [, time]])", "description": "Returns a string or a table containing date and time, formatted according to the given format string. If format starts with '!', the date is formatted in UTC. If format is '*t', returns a table with fields year, month, day, hour, min, sec, wday, yday, isdst.", "type": "function" },
98
- "clock": { "signature": "os.clock()", "description": "Returns an approximation of the amount in seconds of CPU time used by the program, as returned by the underlying ISO C function clock.", "type": "function" },
99
- "execute": { "signature": "os.execute([command])", "description": "Passes command to be executed by an operating system shell. In Lua 5.2+, returns true/nil, exit type ('exit'/'signal'), and exit/signal code. In Lua 5.1, returns the status code.", "type": "function" },
100
- "getenv": { "signature": "os.getenv(varname)", "description": "Returns the value of the process environment variable varname, or nil if the variable is not defined.", "type": "function" },
101
- "rename": { "signature": "os.rename(oldname, newname)", "description": "Renames the file or directory named oldname to newname. If this function fails, it returns nil, plus a string describing the error and the error code.", "type": "function" },
102
- "remove": { "signature": "os.remove(filename)", "description": "Deletes the file (or empty directory on POSIX systems) with the given name. If this function fails, it returns nil, plus a string describing the error and the error code.", "type": "function" },
103
- "tmpname": { "signature": "os.tmpname()", "description": "Returns a string with a file name that can be used for a temporary file. The file must be explicitly opened before its use and explicitly removed when no longer needed.", "type": "function" },
104
- "exit": { "signature": "os.exit([code [, close]])", "description": "Calls the ISO C function exit to terminate the host program. If code is true, the exit status is EXIT_SUCCESS; if false, EXIT_FAILURE; if a number, the exit status is that number. In Lua 5.2+, if close is true, closes the Lua state before exiting.", "type": "function" },
105
- "difftime": { "signature": "os.difftime(t2, t1)", "description": "Returns the difference, in seconds, from time t1 to time t2 (where the times are values returned by os.time).", "type": "function" },
106
- "setlocale": { "signature": "os.setlocale(locale [, category])", "description": "Sets the current locale of the program. Returns the name of the new locale, or nil if the request cannot be honored.", "type": "function" }
530
+ "clock": {
531
+ "signature": "os.clock()",
532
+ "description": "Returns an approximation of the CPU time used by the program, in seconds.",
533
+ "type": "function"
534
+ },
535
+ "time": {
536
+ "signature": "os.time([table])",
537
+ "description": "Returns the current time as a number (usually epoch seconds), or the time represented by the given table.",
538
+ "type": "function"
539
+ },
540
+ "date": {
541
+ "signature": "os.date([format [, time]])",
542
+ "description": "Returns a string or table with date and time, formatted per the format string. '*t' returns a table.",
543
+ "type": "function"
544
+ },
545
+ "difftime": {
546
+ "signature": "os.difftime(t2, t1)",
547
+ "description": "Returns the difference in seconds between times t2 and t1.",
548
+ "type": "function"
549
+ },
550
+ "execute": {
551
+ "signature": "os.execute([command])",
552
+ "description": "Passes command to the OS shell. Returns true/nil, exit type, and exit code (Lua 5.2+). In 5.1 returns a status code.",
553
+ "type": "function"
554
+ },
555
+ "exit": {
556
+ "signature": "os.exit([code [, close]])",
557
+ "description": "Calls the C exit function. code defaults to true (success). If close is true, closes the Lua state first (5.2+).",
558
+ "type": "function"
559
+ },
560
+ "getenv": {
561
+ "signature": "os.getenv(varname)",
562
+ "description": "Returns the value of the environment variable varname, or nil.",
563
+ "type": "function"
564
+ },
565
+ "remove": {
566
+ "signature": "os.remove(filename)",
567
+ "description": "Deletes the file with the given name. Returns true on success, or nil plus error message.",
568
+ "type": "function"
569
+ },
570
+ "rename": {
571
+ "signature": "os.rename(oldname, newname)",
572
+ "description": "Renames a file or directory. Returns true on success, or nil plus error message.",
573
+ "type": "function"
574
+ },
575
+ "tmpname": {
576
+ "signature": "os.tmpname()",
577
+ "description": "Returns a string with a file name for use as a temporary file.",
578
+ "type": "function"
579
+ },
580
+ "setlocale": {
581
+ "signature": "os.setlocale(locale [, category])",
582
+ "description": "Set locale for the program. category: 'all', 'collate', 'ctype', 'monetary', 'numeric', 'time'."
583
+ }
107
584
  }
108
585
  },
109
586
  "coroutine": {
110
587
  "signature": "coroutine library",
111
- "description": "The coroutine library provides operations for coroutine manipulation. A coroutine represents an independent thread of execution that can be suspended (yield) and later resumed. Lua 5.4 adds to-be-closed variables support for coroutines.",
588
+ "description": "Provides functions for creating and managing coroutines (cooperative multithreading).",
112
589
  "type": "module",
113
590
  "module": "coroutine",
114
591
  "members": {
115
- "create": { "signature": "coroutine.create(f)", "description": "Creates a new coroutine with body f. f must be a function. Returns the new coroutine, an object with type 'thread'.", "type": "function" },
116
- "resume": { "signature": "coroutine.resume(co [, val1, ···])", "description": "Starts or continues the execution of coroutine co. The first time you resume, it starts running the body function. Values val1, ... are passed as arguments to the body function (first resume) or as results of yield (subsequent resumes). Returns true plus any values passed to yield, or false plus an error message.", "type": "function" },
117
- "yield": { "signature": "coroutine.yield(···)", "description": "Suspends the execution of the calling coroutine. Any arguments to yield are passed as extra results to resume.", "type": "function" },
118
- "wrap": { "signature": "coroutine.wrap(f)", "description": "Creates a new coroutine with body f and returns a function that resumes the coroutine each time it is called. Any arguments to the function go as extra arguments to resume. Returns the same values as resume, except the first boolean.", "type": "function" },
119
- "status": { "signature": "coroutine.status(co)", "description": "Returns the status of coroutine co as a string: 'running' (currently running), 'suspended' (suspended in a yield or not started), 'normal' (active but not running, i.e., it resumed another coroutine), or 'dead' (finished or stopped with an error).", "type": "function" },
120
- "isyieldable": { "signature": "coroutine.isyieldable()", "description": "Returns true when the running coroutine can yield. A running coroutine is yieldable if it is not the main thread and it is not inside a non-yieldable C function. Available in Lua 5.3+.", "type": "function" },
121
- "close": { "signature": "coroutine.close(co)", "description": "Closes coroutine co, closing all its pending to-be-closed variables and putting the coroutine in a dead state. Available in Lua 5.4 only.", "type": "function" }
592
+ "create": {
593
+ "signature": "coroutine.create(f)",
594
+ "description": "Creates a new coroutine with body f (a function). Returns the new coroutine (a thread value).",
595
+ "type": "function"
596
+ },
597
+ "resume": {
598
+ "signature": "coroutine.resume(co [, val1, ···])",
599
+ "description": "Starts or continues execution of coroutine co. Returns true plus yielded/returned values on success, or false plus error.",
600
+ "type": "function"
601
+ },
602
+ "yield": {
603
+ "signature": "coroutine.yield(···)",
604
+ "description": "Suspends the running coroutine. Arguments become the extra results of resume.",
605
+ "type": "function"
606
+ },
607
+ "wrap": {
608
+ "signature": "coroutine.wrap(f)",
609
+ "description": "Creates a coroutine and returns a function that resumes it each time it is called. Raises errors instead of returning false.",
610
+ "type": "function"
611
+ },
612
+ "status": {
613
+ "signature": "coroutine.status(co)",
614
+ "description": "Returns the status of coroutine co: \"running\", \"suspended\", \"normal\", or \"dead\".",
615
+ "type": "function"
616
+ },
617
+ "isyieldable": {
618
+ "signature": "coroutine.isyieldable()",
619
+ "description": "Returns true if the running coroutine can yield (not the main thread and not inside a non-yieldable C function). Lua 5.3+.",
620
+ "type": "function"
621
+ },
622
+ "running": {
623
+ "signature": "coroutine.running()",
624
+ "description": "Returns the running coroutine plus a boolean: true if the running coroutine is the main thread.",
625
+ "type": "function"
626
+ },
627
+ "close": {
628
+ "signature": "coroutine.close(co)",
629
+ "description": "Closes coroutine co, closing all pending to-be-closed variables and putting the coroutine in a dead state. Lua 5.4+.",
630
+ "type": "function"
631
+ }
122
632
  }
123
633
  },
124
634
  "debug": {
125
635
  "signature": "debug library",
126
- "description": "The debug library provides facilities for debugging and introspection. Unlike other libraries, you should use the debug library only for debugging and similar tasks. Misuse can compromise otherwise-safe code.",
636
+ "description": "Provides a debug interface. Functions in this library should be used only for debugging and profiling; use with care in production code.",
127
637
  "type": "module",
128
638
  "module": "debug",
129
639
  "members": {
130
- "traceback": { "signature": "debug.traceback([thread,] [message [, level]])", "description": "Returns a string with a traceback of the call stack. The optional message string is appended at the beginning. The optional level number tells at which level to start the traceback (default is 1).", "type": "function" },
131
- "getinfo": { "signature": "debug.getinfo([thread,] f [, what])", "description": "Returns a table with information about a function. f can be a function or a stack level number. The what string selects what information to fill in: 'n' (name), 'S' (source), 'l' (current line), 'u' (upvalues), 't' (is tail call), 'L' (valid lines).", "type": "function" },
132
- "getlocal": { "signature": "debug.getlocal([thread,] f, local)", "description": "Returns the name and the value of the local variable with index local of the function at level f of the stack.", "type": "function" },
133
- "setlocal": { "signature": "debug.setlocal([thread,] level, local, value)", "description": "Assigns the value value to the local variable with index local of the function at level level of the stack.", "type": "function" },
134
- "getupvalue": { "signature": "debug.getupvalue(f, up)", "description": "Returns the name and the value of the upvalue with index up of the function f. Returns nil if there is no upvalue with the given index.", "type": "function" },
135
- "setupvalue": { "signature": "debug.setupvalue(f, up, value)", "description": "Assigns the value value to the upvalue with index up of the function f. Returns the name of the upvalue, or nil if there is no upvalue with the given index.", "type": "function" },
136
- "sethook": { "signature": "debug.sethook([thread,] hook, mask [, count])", "description": "Sets the given function as the debug hook. The mask is a string with 'c' (call), 'r' (return), 'l' (line), and count fires after every count instructions.", "type": "function" },
137
- "gethook": { "signature": "debug.gethook([thread])", "description": "Returns the current hook function, the current hook mask, and the current hook count.", "type": "function" },
138
- "getmetatable": { "signature": "debug.getmetatable(value)", "description": "Returns the metatable of the given value. Unlike getmetatable, this function does not check __metatable.", "type": "function" },
139
- "setmetatable": { "signature": "debug.setmetatable(value, table)", "description": "Sets the metatable for the given value to the given table (which can be nil). Returns value. Unlike setmetatable, works on any type of value.", "type": "function" },
140
- "getregistry": { "signature": "debug.getregistry()", "description": "Returns the registry table (a pre-defined table used by the C API to store values).", "type": "function" },
141
- "upvalueid": { "signature": "debug.upvalueid(f, n)", "description": "Returns a unique identifier (as a light userdata) for the upvalue numbered n from the given function. Available in Lua 5.2+.", "type": "function" },
142
- "upvaluejoin": { "signature": "debug.upvaluejoin(f1, n1, f2, n2)", "description": "Make the n1-th upvalue of the Lua closure f1 refer to the n2-th upvalue of the Lua closure f2. Available in Lua 5.2+.", "type": "function" }
640
+ "getinfo": {
641
+ "signature": "debug.getinfo([thread,] f [, what])",
642
+ "description": "Returns a table with information about a function. f can be a function or a stack level. 'what' selects which fields to fill.",
643
+ "type": "function"
644
+ },
645
+ "traceback": {
646
+ "signature": "debug.traceback([thread,] [message [, level]])",
647
+ "description": "Returns a string with a traceback of the call stack. An optional message is prepended.",
648
+ "type": "function"
649
+ },
650
+ "sethook": {
651
+ "signature": "debug.sethook([thread,] hook, mask [, count])",
652
+ "description": "Sets the given function as a debug hook. Mask is a string with \"c\" (call), \"r\" (return), \"l\" (line).",
653
+ "type": "function"
654
+ },
655
+ "getlocal": {
656
+ "signature": "debug.getlocal([thread,] f, local)",
657
+ "description": "Returns the name and value of the local variable at index local of function at level f.",
658
+ "type": "function"
659
+ },
660
+ "setlocal": {
661
+ "signature": "debug.setlocal([thread,] level, local, value)",
662
+ "description": "Assigns value to the local variable at index local of function at stack level.",
663
+ "type": "function"
664
+ },
665
+ "getupvalue": {
666
+ "signature": "debug.getupvalue(f, up)",
667
+ "description": "Returns the name and value of the upvalue at index up of function f.",
668
+ "type": "function"
669
+ },
670
+ "setupvalue": {
671
+ "signature": "debug.setupvalue(f, up, value)",
672
+ "description": "Assigns value to the upvalue at index up of function f. Returns the upvalue name or nil.",
673
+ "type": "function"
674
+ },
675
+ "getmetatable": {
676
+ "signature": "debug.getmetatable(value)",
677
+ "description": "Returns the metatable of value without checking __metatable.",
678
+ "type": "function"
679
+ },
680
+ "setmetatable": {
681
+ "signature": "debug.setmetatable(value, table)",
682
+ "description": "Sets the metatable for value to table (can be nil). Returns value.",
683
+ "type": "function"
684
+ },
685
+ "getuservalue": {
686
+ "signature": "debug.getuservalue(u [, n])",
687
+ "description": "Returns the n-th user value associated with userdata u. Lua 5.4 added the n parameter.",
688
+ "type": "function"
689
+ },
690
+ "setuservalue": {
691
+ "signature": "debug.setuservalue(udata, value [, n])",
692
+ "description": "Sets value as the n-th user value associated with userdata. Returns udata.",
693
+ "type": "function"
694
+ },
695
+ "gethook": {
696
+ "signature": "debug.gethook([thread])",
697
+ "description": "Returns current hook function, mask, and count."
698
+ },
699
+ "getregistry": {
700
+ "signature": "debug.getregistry()",
701
+ "description": "Returns the Lua registry table."
702
+ },
703
+ "upvalueid": {
704
+ "signature": "debug.upvalueid(f, n)",
705
+ "description": "Returns unique identifier for upvalue n of function f. (5.2+)"
706
+ },
707
+ "upvaluejoin": {
708
+ "signature": "debug.upvaluejoin(f1, n1, f2, n2)",
709
+ "description": "Makes upvalue n1 of f1 refer to same upvalue as n2 of f2. (5.2+)"
710
+ }
143
711
  }
144
712
  },
145
- "metatable": {
146
- "signature": "Metatables and Metamethods",
147
- "description": "Every value in Lua can have a metatable. A metatable is a regular Lua table that defines the behavior of the original value under certain operations. Metamethods are functions stored in a metatable with special keys that Lua recognizes. Use setmetatable(table, metatable) to set and getmetatable(obj) to retrieve.",
148
- "type": "concept",
149
- "module": "metatable",
713
+ "package": {
714
+ "signature": "package library",
715
+ "description": "Provides facilities for loading modules. Used by require to find and load modules.",
716
+ "type": "module",
717
+ "module": "package",
150
718
  "members": {
151
- "__index": { "signature": "__index: table | function(table, key)", "description": "Called when a table access (table[key]) fails. If __index is a table, the access is retried on that table. If it is a function, it is called with the table and the key. This is the primary mechanism for implementing inheritance and prototype chains.", "type": "metamethod" },
152
- "__newindex": { "signature": "__newindex: table | function(table, key, value)", "description": "Called when a table assignment (table[key] = value) is made to an absent key. If __newindex is a table, the assignment is done on that table. If it is a function, it is called instead of performing the assignment. Use rawset to bypass.", "type": "metamethod" },
153
- "__add": { "signature": "__add: function(op1, op2)", "description": "Called for the addition (+) operation. If any operand is not a number (nor a coercible string), Lua tries this metamethod. The function is called with the two operands.", "type": "metamethod" },
154
- "__sub": { "signature": "__sub: function(op1, op2)", "description": "Called for the subtraction (-) operation. Behavior analogous to __add.", "type": "metamethod" },
155
- "__mul": { "signature": "__mul: function(op1, op2)", "description": "Called for the multiplication (*) operation. Behavior analogous to __add.", "type": "metamethod" },
156
- "__div": { "signature": "__div: function(op1, op2)", "description": "Called for the float division (/) operation. Behavior analogous to __add.", "type": "metamethod" },
157
- "__mod": { "signature": "__mod: function(op1, op2)", "description": "Called for the modulo (%) operation. Behavior analogous to __add.", "type": "metamethod" },
158
- "__pow": { "signature": "__pow: function(op1, op2)", "description": "Called for the exponentiation (^) operation. Behavior analogous to __add.", "type": "metamethod" },
159
- "__unm": { "signature": "__unm: function(op)", "description": "Called for the unary minus (negation, -x) operation.", "type": "metamethod" },
160
- "__concat": { "signature": "__concat: function(op1, op2)", "description": "Called for the concatenation (..) operation. If any operand is neither a string nor a number, Lua tries this metamethod.", "type": "metamethod" },
161
- "__len": { "signature": "__len: function(op)", "description": "Called for the length (#) operation. Allows you to customize the behavior of the # operator for tables.", "type": "metamethod" },
162
- "__eq": { "signature": "__eq: function(op1, op2)", "description": "Called for the equality (==) operation. Only called when the two objects being compared share the same metatable for this event (or both have this metamethod). Result is always converted to boolean.", "type": "metamethod" },
163
- "__lt": { "signature": "__lt: function(op1, op2)", "description": "Called for the less-than (<) operation. Also used for the greater-than (>) operation (a > b becomes b < a). Result is always converted to boolean.", "type": "metamethod" },
164
- "__le": { "signature": "__le: function(op1, op2)", "description": "Called for the less-than-or-equal (<=) operation. Also used for >= operations. Result is always converted to boolean.", "type": "metamethod" },
165
- "__call": { "signature": "__call: function(func, ...)", "description": "Called when a value is called as a function. The metamethod receives the called object as first argument, followed by the arguments of the original call. Allows non-function values to be called.", "type": "metamethod" },
166
- "__tostring": { "signature": "__tostring: function(op)", "description": "Called by the tostring function and string conversion. Must return a string. If this metamethod exists, tostring calls it with the object as argument and uses the result.", "type": "metamethod" },
167
- "__gc": { "signature": "__gc: function(op)", "description": "Called when the garbage collector detects that the corresponding object is unreachable (finalizer). In Lua 5.4, works on tables too. In earlier versions, only userdata. The __gc metamethod must be set before the object becomes garbage.", "type": "metamethod" },
168
- "__close": { "signature": "__close: function(op, err)", "description": "Called when a to-be-closed variable goes out of scope. Available in Lua 5.4 only. The second parameter is the error object if the scope was left due to an error, or nil otherwise. Declared with: local obj <close> = value.", "type": "metamethod" },
169
- "__idiv": { "signature": "__idiv: function(op1, op2)", "description": "Called for the floor division (//) operation. Available in Lua 5.3+. Behavior analogous to __add.", "type": "metamethod" },
170
- "__band": { "signature": "__band: function(op1, op2)", "description": "Called for the bitwise AND (&) operation. Available in Lua 5.3+.", "type": "metamethod" },
171
- "__bor": { "signature": "__bor: function(op1, op2)", "description": "Called for the bitwise OR (|) operation. Available in Lua 5.3+.", "type": "metamethod" },
172
- "__bxor": { "signature": "__bxor: function(op1, op2)", "description": "Called for the bitwise exclusive OR (~) operation. Available in Lua 5.3+.", "type": "metamethod" },
173
- "__bnot": { "signature": "__bnot: function(op)", "description": "Called for the bitwise NOT (~) operation. Available in Lua 5.3+.", "type": "metamethod" },
174
- "__shl": { "signature": "__shl: function(op1, op2)", "description": "Called for the bitwise left shift (<<) operation. Available in Lua 5.3+.", "type": "metamethod" },
175
- "__shr": { "signature": "__shr: function(op1, op2)", "description": "Called for the bitwise right shift (>>) operation. Available in Lua 5.3+.", "type": "metamethod" },
176
- "__metatable": { "signature": "__metatable: any", "description": "If set, getmetatable returns this value instead of the real metatable, and setmetatable raises an error. Used to protect the metatable from being modified.", "type": "field" },
177
- "__pairs": { "signature": "__pairs: function(table)", "description": "Called by the pairs function to provide a custom iterator. Available in Lua 5.2; removed in Lua 5.4 (use __iter instead or rely on default behavior).", "type": "metamethod" }
719
+ "path": {
720
+ "signature": "package.path",
721
+ "description": "A string with the path used by require to search for Lua modules. Uses templates with '?' as the module name placeholder.",
722
+ "type": "field"
723
+ },
724
+ "cpath": {
725
+ "signature": "package.cpath",
726
+ "description": "A string with the path used by require to search for C modules.",
727
+ "type": "field"
728
+ },
729
+ "loaded": {
730
+ "signature": "package.loaded",
731
+ "description": "A table of already-loaded modules. require checks this table first.",
732
+ "type": "field"
733
+ },
734
+ "preload": {
735
+ "signature": "package.preload",
736
+ "description": "A table of loader functions indexed by module name. Checked by require before file searchers.",
737
+ "type": "field"
738
+ },
739
+ "searchers": {
740
+ "signature": "package.searchers",
741
+ "description": "An array of searcher functions used by require to find a module. In Lua 5.1, this is package.loaders.",
742
+ "type": "field"
743
+ },
744
+ "searchpath": {
745
+ "signature": "package.searchpath(name, path [, sep [, rep]])",
746
+ "description": "Searches for the given name in the given path. Returns the first file that can be opened, or nil plus an error.",
747
+ "type": "function"
748
+ },
749
+ "config": {
750
+ "signature": "package.config",
751
+ "description": "A string with compile-time configuration for packages (directory separator, path separator, template wildcard, etc.).",
752
+ "type": "field"
753
+ },
754
+ "loadlib": {
755
+ "signature": "package.loadlib(libname, funcname)",
756
+ "description": "Dynamically links the C library libname and returns funcname as a C function."
757
+ }
178
758
  }
759
+ },
760
+ "utf8": {
761
+ "signature": "utf8 library",
762
+ "description": "Provides basic support for UTF-8 encoding. Available in Lua 5.3+.",
763
+ "type": "module",
764
+ "module": "utf8",
765
+ "members": {
766
+ "char": {
767
+ "signature": "utf8.char(···)",
768
+ "description": "Receives zero or more integers and returns a string with each character having the given code point.",
769
+ "type": "function"
770
+ },
771
+ "codepoint": {
772
+ "signature": "utf8.codepoint(s [, i [, j]])",
773
+ "description": "Returns the code points of all characters in s between positions i and j.",
774
+ "type": "function"
775
+ },
776
+ "codes": {
777
+ "signature": "utf8.codes(s)",
778
+ "description": "Returns an iterator yielding (position, codepoint) for each UTF-8 character in s.",
779
+ "type": "function"
780
+ },
781
+ "len": {
782
+ "signature": "utf8.len(s [, i [, j]])",
783
+ "description": "Returns the number of UTF-8 characters in s between positions i and j. Returns nil plus error position if invalid UTF-8.",
784
+ "type": "function"
785
+ },
786
+ "offset": {
787
+ "signature": "utf8.offset(s, n [, i])",
788
+ "description": "Returns the byte position where the n-th UTF-8 character starts (counting from position i).",
789
+ "type": "function"
790
+ },
791
+ "charpattern": {
792
+ "signature": "utf8.charpattern",
793
+ "description": "The pattern \"[\\0-\\x7F\\xC2-\\xFD][\\x80-\\xBF]*\" which matches exactly one UTF-8 byte sequence.",
794
+ "type": "field"
795
+ }
796
+ }
797
+ },
798
+ "and": {
799
+ "signature": "and",
800
+ "description": "Logical AND operator. Returns the first false argument or the last argument. Short-circuit evaluation.",
801
+ "type": "keyword",
802
+ "module": "builtin"
803
+ },
804
+ "break": {
805
+ "signature": "break",
806
+ "description": "Terminates the execution of the innermost while, repeat, or for loop.",
807
+ "type": "keyword",
808
+ "module": "builtin"
809
+ },
810
+ "do": {
811
+ "signature": "do",
812
+ "description": "Starts a block of code. Paired with 'end'.",
813
+ "type": "keyword",
814
+ "module": "builtin"
815
+ },
816
+ "else": {
817
+ "signature": "else",
818
+ "description": "Alternative branch in an if statement.",
819
+ "type": "keyword",
820
+ "module": "builtin"
821
+ },
822
+ "elseif": {
823
+ "signature": "elseif",
824
+ "description": "Additional conditional branch in an if statement. Avoids nesting.",
825
+ "type": "keyword",
826
+ "module": "builtin"
827
+ },
828
+ "end": {
829
+ "signature": "end",
830
+ "description": "Closes a block started by function, if, for, while, repeat, or do.",
831
+ "type": "keyword",
832
+ "module": "builtin"
833
+ },
834
+ "false": {
835
+ "signature": "false",
836
+ "description": "Boolean false value. Together with nil, is the only falsy value in Lua.",
837
+ "type": "keyword",
838
+ "module": "builtin"
839
+ },
840
+ "for": {
841
+ "signature": "for",
842
+ "description": "Starts a for loop, either numeric (for i = a, b, c) or generic (for k, v in iter).",
843
+ "type": "keyword",
844
+ "module": "builtin"
845
+ },
846
+ "function": {
847
+ "signature": "function",
848
+ "description": "Declares a function. Can be used as a statement or an expression.",
849
+ "type": "keyword",
850
+ "module": "builtin"
851
+ },
852
+ "goto": {
853
+ "signature": "goto",
854
+ "description": "Unconditional jump to a label. Available in Lua 5.2+.",
855
+ "type": "keyword",
856
+ "module": "builtin"
857
+ },
858
+ "if": {
859
+ "signature": "if",
860
+ "description": "Starts a conditional statement.",
861
+ "type": "keyword",
862
+ "module": "builtin"
863
+ },
864
+ "in": {
865
+ "signature": "in",
866
+ "description": "Used in generic for loops: for k, v in iterator do ... end.",
867
+ "type": "keyword",
868
+ "module": "builtin"
869
+ },
870
+ "local": {
871
+ "signature": "local",
872
+ "description": "Declares a local variable or function, scoped to the enclosing block.",
873
+ "type": "keyword",
874
+ "module": "builtin"
875
+ },
876
+ "nil": {
877
+ "signature": "nil",
878
+ "description": "The type nil has one value: nil. Represents the absence of a useful value.",
879
+ "type": "keyword",
880
+ "module": "builtin"
881
+ },
882
+ "not": {
883
+ "signature": "not",
884
+ "description": "Logical NOT operator. Returns true if argument is false or nil, otherwise false.",
885
+ "type": "keyword",
886
+ "module": "builtin"
887
+ },
888
+ "or": {
889
+ "signature": "or",
890
+ "description": "Logical OR operator. Returns the first true argument or the last argument. Short-circuit evaluation.",
891
+ "type": "keyword",
892
+ "module": "builtin"
893
+ },
894
+ "repeat": {
895
+ "signature": "repeat",
896
+ "description": "Starts a repeat-until loop, which executes at least once.",
897
+ "type": "keyword",
898
+ "module": "builtin"
899
+ },
900
+ "return": {
901
+ "signature": "return",
902
+ "description": "Returns values from a function. Must be the last statement in a block.",
903
+ "type": "keyword",
904
+ "module": "builtin"
905
+ },
906
+ "then": {
907
+ "signature": "then",
908
+ "description": "Required after the condition in an if or elseif clause.",
909
+ "type": "keyword",
910
+ "module": "builtin"
911
+ },
912
+ "true": {
913
+ "signature": "true",
914
+ "description": "Boolean true value.",
915
+ "type": "keyword",
916
+ "module": "builtin"
917
+ },
918
+ "until": {
919
+ "signature": "until",
920
+ "description": "Ends a repeat-until loop. The condition is tested after each iteration.",
921
+ "type": "keyword",
922
+ "module": "builtin"
923
+ },
924
+ "while": {
925
+ "signature": "while",
926
+ "description": "Starts a while loop that repeats while a condition is true.",
927
+ "type": "keyword",
928
+ "module": "builtin"
179
929
  }
180
930
  }
181
- }
931
+ }