@enjoys/context-engine 1.0.0 → 1.0.2
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.
- package/data/commands/adb.json +322 -0
- package/data/commands/alembic.json +301 -0
- package/data/commands/artisan.json +277 -0
- package/data/commands/atlas.json +426 -0
- package/data/commands/auth0.json +648 -0
- package/data/commands/bat.json +84 -0
- package/data/commands/btop.json +59 -0
- package/data/commands/bundle.json +321 -0
- package/data/commands/composer.json +507 -0
- package/data/commands/dart.json +216 -0
- package/data/commands/dbmate.json +257 -0
- package/data/commands/docker-compose.json +384 -0
- package/data/commands/drizzle-kit.json +217 -0
- package/data/commands/expo.json +65 -0
- package/data/commands/fastlane.json +243 -0
- package/data/commands/fd.json +86 -0
- package/data/commands/flutter.json +298 -0
- package/data/commands/flyway.json +261 -0
- package/data/commands/fzf.json +103 -0
- package/data/commands/gem.json +267 -0
- package/data/commands/htop.json +56 -0
- package/data/commands/jq.json +100 -0
- package/data/commands/k9s.json +62 -0
- package/data/commands/linux.json +3007 -0
- package/data/commands/liquibase.json +399 -0
- package/data/commands/manifest.json +619 -0
- package/data/commands/minikube.json +60 -0
- package/data/commands/ng.json +64 -0
- package/data/commands/nuxt.json +60 -0
- package/data/commands/nvim.json +91 -0
- package/data/commands/php.json +157 -0
- package/data/commands/pm2.json +259 -0
- package/data/commands/pod.json +175 -0
- package/data/commands/prisma.json +257 -0
- package/data/commands/rails.json +372 -0
- package/data/commands/rake.json +360 -0
- package/data/commands/react-native.json +57 -0
- package/data/commands/rg.json +103 -0
- package/data/commands/rspec.json +257 -0
- package/data/commands/ruby.json +108 -0
- package/data/commands/screen.json +101 -0
- package/data/commands/sequelize.json +342 -0
- package/data/commands/snyk.json +442 -0
- package/data/commands/sonar-scanner.json +219 -0
- package/data/commands/stripe.json +314 -0
- package/data/commands/symfony.json +449 -0
- package/data/commands/tmux.json +197 -0
- package/data/commands/top.json +61 -0
- package/data/commands/trivy.json +367 -0
- package/data/commands/twilio.json +382 -0
- package/data/commands/typeorm.json +262 -0
- package/data/commands/vim.json +85 -0
- package/data/commands/vue.json +60 -0
- package/data/commands/wp.json +857 -0
- package/data/commands/xcodebuild.json +141 -0
- package/data/commands/yq.json +57 -0
- package/data/completion/bash.json +1184 -0
- package/data/completion/c.json +1067 -0
- package/data/completion/cpp.json +824 -0
- package/data/completion/csharp.json +860 -0
- package/data/completion/dockerfile.json +536 -0
- package/data/completion/go.json +1346 -0
- package/data/completion/html.json +806 -0
- package/data/completion/java.json +1112 -0
- package/data/completion/javascript.json +914 -0
- package/data/completion/lua.json +968 -0
- package/data/completion/php.json +1535 -0
- package/data/completion/python.json +1427 -0
- package/data/completion/ruby.json +1531 -0
- package/data/completion/rust.json +698 -0
- package/data/completion/sql.json +887 -0
- package/data/completion/toml.json +428 -0
- package/data/completion/typescript.json +338 -0
- package/data/completion/yaml.json +563 -0
- package/data/defination/bash.json +565 -0
- package/data/defination/c.json +865 -0
- package/data/defination/cpp.json +348 -0
- package/data/defination/csharp.json +144 -0
- package/data/defination/dockerfile.json +113 -0
- package/data/defination/go.json +561 -0
- package/data/defination/html.json +559 -0
- package/data/defination/java.json +184 -0
- package/data/defination/javascript.json +265 -0
- package/data/defination/lua.json +181 -0
- package/data/defination/php.json +726 -0
- package/data/defination/python.json +717 -0
- package/data/defination/ruby.json +670 -0
- package/data/defination/rust.json +207 -0
- package/data/defination/sql.json +473 -0
- package/data/defination/toml.json +251 -0
- package/data/defination/typescript.json +29 -0
- package/data/defination/yaml.json +197 -0
- package/data/hover/bash.json +245 -0
- package/data/hover/c.json +265 -0
- package/data/hover/cpp.json +210 -0
- package/data/hover/csharp.json +290 -0
- package/data/hover/dockerfile.json +145 -0
- package/data/hover/go.json +580 -0
- package/data/hover/html.json +250 -0
- package/data/hover/java.json +395 -0
- package/data/hover/javascript.json +330 -0
- package/data/hover/lua.json +265 -0
- package/data/hover/php.json +300 -0
- package/data/hover/python.json +380 -0
- package/data/hover/ruby.json +265 -0
- package/data/hover/rust.json +275 -0
- package/data/hover/sql.json +230 -0
- package/data/hover/toml.json +145 -0
- package/data/hover/typescript.json +120 -0
- package/data/hover/yaml.json +165 -0
- package/data/manifest.json +242 -0
- package/package.json +1 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "lua",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"string": {
|
|
5
|
+
"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.",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"module": "string",
|
|
9
|
+
"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" }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"table": {
|
|
27
|
+
"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).",
|
|
29
|
+
"type": "module",
|
|
30
|
+
"module": "table",
|
|
31
|
+
"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" }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"math": {
|
|
42
|
+
"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+).",
|
|
44
|
+
"type": "module",
|
|
45
|
+
"module": "math",
|
|
46
|
+
"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" }
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"io": {
|
|
73
|
+
"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.",
|
|
75
|
+
"type": "module",
|
|
76
|
+
"module": "io",
|
|
77
|
+
"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" }
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"os": {
|
|
91
|
+
"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.",
|
|
93
|
+
"type": "module",
|
|
94
|
+
"module": "os",
|
|
95
|
+
"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" }
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"coroutine": {
|
|
110
|
+
"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.",
|
|
112
|
+
"type": "module",
|
|
113
|
+
"module": "coroutine",
|
|
114
|
+
"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" }
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"debug": {
|
|
125
|
+
"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.",
|
|
127
|
+
"type": "module",
|
|
128
|
+
"module": "debug",
|
|
129
|
+
"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" }
|
|
143
|
+
}
|
|
144
|
+
},
|
|
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",
|
|
150
|
+
"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" }
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|