aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-02-20 11:05:03 -0500
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-02-20 11:05:03 -0500
commitce352e93b2e4ddfa39907b8f50f98cfd6e54e593 (patch)
tree8d7e3b72486519d43e46224c4bb8729d8fe6a4ca /modules
parent7def99140aa8d9e3a4cdd0b678afed9adea95b69 (diff)
Updated to Lua 5.4.2.
Diffstat (limited to 'modules')
-rw-r--r--modules/ansi_c/lua_api210
-rw-r--r--modules/lua/api132
-rw-r--r--modules/lua/lua.luadoc565
-rw-r--r--modules/lua/ta_tags8
-rw-r--r--modules/lua/tags20
5 files changed, 538 insertions, 397 deletions
diff --git a/modules/ansi_c/lua_api b/modules/ansi_c/lua_api
index f9065fb8..9564a407 100644
--- a/modules/ansi_c/lua_api
+++ b/modules/ansi_c/lua_api
@@ -1,34 +1,34 @@
-lua_absindex lua_absindex(lua_State *L, int idx) [int]\nConverts the acceptable index `idx` into an absolute index (that is, one that\ndoes not depend on the stack top).\n
-lua_Alloc (*lua_Alloc)(void *ud, void *ptr, size_t osize, size_t nsize) [void*]\nThe type of the memory-allocation function used by Lua states. The allocator\nfunction must provide a functionality similar to `realloc`, but not exactly\nthe same. Its arguments are `ud`, an opaque pointer passed to `lua_newstate`;\n`ptr`, a pointer to the block being allocated/reallocated/freed; `osize`,\nthe original size of the block or some code about what is being allocated;\nand `nsize`, the new size of the block.\n\nWhen `ptr` is not `NULL`, `osize` is the size of the block pointed by `ptr`,\nthat is, the size given when it was allocated or reallocated.\n\nWhen `ptr` is `NULL`, `osize` encodes the kind of object that Lua is allocating.\n`osize` is any of `LUA_TSTRING`, `LUA_TTABLE`, `LUA_TFUNCTION`, `LUA_TUSERDATA`,\nor `LUA_TTHREAD` when (and only when) Lua is creating a new object of that type.\nWhen `osize` is some other value, Lua is allocating memory for something else.\n\nLua assumes the following behavior from the allocator function:\n\nWhen `nsize` is zero, the allocator must behave like `free` and return `NULL`.\n\nWhen `nsize` is not zero, the allocator must behave like `realloc`. The\nallocator returns `NULL` if and only if it cannot fulfill the request. Lua\nassumes that the allocator never fails when `osize >= nsize`.\n\nHere is a simple implementation for the allocator function. It is used in\nthe auxiliary library by `luaL_newstate`.\n\n static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {\n (void)ud; (void)osize; /* not used */\n if (nsize == 0) {\n free(ptr);\n return NULL;\n }\n else\n return realloc(ptr, nsize);\n }\n\nNote that Standard C ensures that `free(NULL)` has no effect and that\n`realloc(NULL, size)` is equivalent to `malloc(size)`. This code assumes that\n`realloc` does not fail when shrinking a block. (Although Standard C does not\nensure this behavior, it seems to be a safe assumption.)\n
-lua_arith lua_arith(lua_State *L, int op) [void]\nPerforms an arithmetic or bitwise operation over the two values (or one, in the\ncase of negations) at the top of the stack, with the value at the top being the\nsecond operand, pops these values, and pushes the result of the operation. The\nfunction follows the semantics of the corresponding Lua operator (that is, it\nmay call metamethods).\n\nThe value of `op` must be one of the following constants:\n * LUA_OPADD: performs addition (`+`)\n * LUA_OPSUB: performs subtraction (`-`)\n * LUA_OPMUL: performs multiplication (`*`)\n * LUA_OPDIV: performs float division (`/`)\n * LUA_OPIDIV: performs floor division (`//`)\n * LUA_OPMOD: performs modulo (`%`)\n * LUA_OPPOW: performs exponentiation (`^`)\n * LUA_OPUNM: performs mathematical negation (unary `-`)\n * LUA_OPBNOT: performs bitwise NOT (`~`)\n * LUA_OPBAND: performs bitwise AND (`&`)\n * LUA_OPBOR: performs bitwise OR (`|`)\n * LUA_OPBXOR: performs bitwise exclusive OR (`~`)\n * LUA_OPBSHL: performs left shift (`<<`)\n * LUA_OPBSHR: performs right shift (`>>`)\n
-lua_atpanic lua_atpanic(lua_State *L, lua_CFunction panicf) [lua_CFunction]\nSets a new panic function and returns the old one (see §4.6).\n\nIf an error happens outside any protected environment, Lua calls a _panic\nfunction_ and then calls `abort`, thus exiting the host application. Your panic\nfunction can avoid this exit by never returning (e.g., doing a long jump).\n\nThe panic function runs as if it were a message handler (see §2.3); in\nparticular, the error message is at the top of the stack. However, there is no\nguarantees about stack space. To push anything on the stack, the panic function\nshould first check the available space (see §4.2).\n
-lua_call lua_call(lua_State *L, int nargs, int nresults) [void]\nCalls a function.\n\nTo call a function you must use the following protocol: first, the function\nto be called is pushed onto the stack; then, the arguments to the function\nare pushed in direct order; that is, the first argument is pushed first.\nFinally you call `lua_call`; `nargs` is the number of arguments that you\npushed onto the stack. All arguments and the function value are popped from\nthe stack when the function is called. The function results are pushed onto\nthe stack when the function returns. The number of results is adjusted to\n`nresults`, unless `nresults` is `LUA_MULTRET`. In this case, all results from\nthe function are pushed. Lua takes care that the returned values fit into the\nstack space, but it does not ensure any extra space on the stack. The function\nresults are pushed onto the stack in direct order (the first result is pushed\nfirst), so that after the call the last result is on the top of the stack.\n\nAny error inside the called function is propagated upwards (with a `longjmp`).\n\nThe following example shows how the host program can do the equivalent to\nthis Lua code:\n\n a = f("how", t.x, 14)\n\nHere it is in C:\n\n lua_getglobal(L, "f"); /* function to be called */\n lua_pushliteral(L, "how"); /* 1st argument */\n lua_getglobal(L, "t"); /* table to be indexed */\n lua_getfield(L, -1, "x"); /* push result of t.x (2nd arg) */\n lua_remove(L, -2); /* remove 't' from the stack */\n lua_pushinteger(L, 14); /* 3rd argument */\n lua_call(L, 3, 1); /* call 'f' with 3 arguments and 1 result */\n lua_setglobal(L, "a"); /* set global 'a' */\n\nNote that the code above is _balanced_: at its end, the stack is back to\nits original configuration. This is considered good programming practice.\n
-lua_callk lua_callk(lua_State *L, int nargs, int nresults, lua_KContext ctx, lua_KFunction k) [void]\nThis function behaves exactly like `lua_call`, but allows the called function to\nyield (see §4.7).\n
-lua_CFunction (*lua_CFunction)(lua_State *L) [int]\nType for C functions.\n\nIn order to communicate properly with Lua, a C function must use the\nfollowing protocol, which defines the way parameters and results are passed:\na C function receives its arguments from Lua in its stack in direct order\n(the first argument is pushed first). So, when the function starts,\n`lua_gettop(L)` returns the number of arguments received by the function.\nThe first argument (if any) is at index 1 and its last argument is at index\n`lua_gettop(L)`. To return values to Lua, a C function just pushes them onto\nthe stack, in direct order (the first result is pushed first), and returns\nthe number of results. Any other value in the stack below the results will\nbe properly discarded by Lua. Like a Lua function, a C function called by\nLua can also return many results.\n\nAs an example, the following function receives a variable number of numerical\narguments and returns their average and their sum:\n\n static int foo (lua_State *L) {\n int n = lua_gettop(L); /* number of arguments */\n lua_Number sum = 0.0;\n int i;\n for (i = 1; i <= n; i++) {\n if (!lua_isnumber(L, i)) {\n lua_pushliteral(L, "incorrect argument");\n lua_error(L);\n }\n sum += lua_tonumber(L, i);\n }\n lua_pushnumber(L, sum/n); /* first result */\n lua_pushnumber(L, sum); /* second result */\n return 2; /* number of results */\n }\n
-lua_checkstack lua_checkstack(lua_State *L, int n) [int]\nEnsures that the stack has space for at least `n` extra slots (that is, that you\ncan safely push up to `n` values onto it).\nIt returns false if it cannot fulfill the request, either because it would cause\nthe stack to be larger than a fixed maximum size (typically at least several\nthousand elements) or because it cannot allocate memory for the extra space.\nThis function never shrinks the stack; if the stack already has space for the\nextra slots, it is left unchanged.\n
-lua_close lua_close(lua_State *L) [void]\nDestroys all objects in the given Lua state (calling the corresponding\ngarbage-collection metamethods, if any) and frees all dynamic memory used by\nthis state. On several platforms, you may not need to call this function,\nbecause all resources are naturally released when the host program ends.\nOn the other hand, long-running programs that create multiple states, such as\ndaemons or web servers, will probably need to close states as soon as they are\nnot needed.\n
+lua_absindex lua_absindex(lua_State *L, int idx) [int]\nConverts the acceptable index `idx` into an absolute index (that is, one that\ndoes not depend on the stack size).\n
+lua_Alloc (*lua_Alloc)(void *ud, void *ptr, size_t osize, size_t nsize) [void*]\nThe type of the memory-allocation function used by Lua states. The allocator\nfunction must provide a functionality similar to `realloc`, but not exactly\nthe same. Its arguments are `ud`, an opaque pointer passed to `lua_newstate`;\n`ptr`, a pointer to the block being allocated/reallocated/freed; `osize`,\nthe original size of the block or some code about what is being allocated;\nand `nsize`, the new size of the block.\n\nWhen `ptr` is not `NULL`, `osize` is the size of the block pointed by `ptr`,\nthat is, the size given when it was allocated or reallocated.\n\nWhen `ptr` is `NULL`, `osize` encodes the kind of object that Lua is allocating.\n`osize` is any of `LUA_TSTRING`, `LUA_TTABLE`, `LUA_TFUNCTION`, `LUA_TUSERDATA`,\nor `LUA_TTHREAD` when (and only when) Lua is creating a new object of that type.\nWhen `osize` is some other value, Lua is allocating memory for something else.\n\nLua assumes the following behavior from the allocator function:\n\nWhen `nsize` is zero, the allocator must behave like `free` and then return\n`NULL`.\n\nWhen `nsize` is not zero, the allocator must behave like `realloc`. In\nparticular, the allocator returns `NULL` if and only if it cannot fulfill the\nrequest.\n\nHere is a simple implementation for the allocator function. It is used in\nthe auxiliary library by `luaL_newstate`.\n\n static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {\n (void)ud; (void)osize; /* not used */\n if (nsize == 0) {\n free(ptr);\n return NULL;\n }\n else\n return realloc(ptr, nsize);\n }\n\nNote that Standard C ensures that `free(NULL)` has no effect and that\n`realloc(NULL, size)` is equivalent to `malloc(size)`.\n
+lua_arith lua_arith(lua_State *L, int op) [void]\nPerforms an arithmetic or bitwise operation over the two values (or one, in the\ncase of negations) at the top of the stack, with the value on the top being the\nsecond operand, pops these values, and pushes the result of the operation. The\nfunction follows the semantics of the corresponding Lua operator (that is, it\nmay call metamethods).\n\nThe value of `op` must be one of the following constants:\n * LUA_OPADD: performs addition (`+`)\n * LUA_OPSUB: performs subtraction (`-`)\n * LUA_OPMUL: performs multiplication (`*`)\n * LUA_OPDIV: performs float division (`/`)\n * LUA_OPIDIV: performs floor division (`//`)\n * LUA_OPMOD: performs modulo (`%`)\n * LUA_OPPOW: performs exponentiation (`^`)\n * LUA_OPUNM: performs mathematical negation (unary `-`)\n * LUA_OPBNOT: performs bitwise NOT (`~`)\n * LUA_OPBAND: performs bitwise AND (`&`)\n * LUA_OPBOR: performs bitwise OR (`|`)\n * LUA_OPBXOR: performs bitwise exclusive OR (`~`)\n * LUA_OPBSHL: performs left shift (`<<`)\n * LUA_OPBSHR: performs right shift (`>>`)\n
+lua_atpanic lua_atpanic(lua_State *L, lua_CFunction panicf) [lua_CFunction]\nSets a new panic function and returns the old one (see §4.4).\n
+lua_call lua_call(lua_State *L, int nargs, int nresults) [void]\nCalls a function.\nLike regular Lua calls, `lua_call` respects the `__call` metamethod. So, here\nthe word "function" means any callable value.\n\nTo do a call you must use the following protocol: first, the function to be\ncalled is pushed onto the stack; then, the arguments to the call are pushed in\ndirect order; that is, the first argument is pushed first. Finally you call\n`lua_call`; `nargs` is the number of arguments that you pushed onto the stack.\nWhen the function returns, all arguments and the function value are popped and\nthe call results are pushed onto the stack when the function returns. The\nnumber of results is adjusted to `nresults`, unless `nresults` is `LUA_MULTRET`.\nIn this case, all results from the function are pushed. Lua takes care that the\nreturned values fit into the stack space, but it does not ensure any extra space\non the stack. The function results are pushed onto the stack in direct order\n(the first result is pushed first), so that after the call the last result is on\nthe top of the stack.\n\nAny error while calling and running the function is propagated upwards (with a\n`longjmp`).\n\nThe following example shows how the host program can do the equivalent to\nthis Lua code:\n\n a = f("how", t.x, 14)\n\nHere it is in C:\n\n lua_getglobal(L, "f"); /* function to be called */\n lua_pushliteral(L, "how"); /* 1st argument */\n lua_getglobal(L, "t"); /* table to be indexed */\n lua_getfield(L, -1, "x"); /* push result of t.x (2nd arg) */\n lua_remove(L, -2); /* remove 't' from the stack */\n lua_pushinteger(L, 14); /* 3rd argument */\n lua_call(L, 3, 1); /* call 'f' with 3 arguments and 1 result */\n lua_setglobal(L, "a"); /* set global 'a' */\n\nNote that the code above is _balanced_: at its end, the stack is back to\nits original configuration. This is considered good programming practice.\n
+lua_callk lua_callk(lua_State *L, int nargs, int nresults, lua_KContext ctx, lua_KFunction k) [void]\nThis function behaves exactly like `lua_call`, but allows the called function to\nyield (see §4.5).\n
+lua_CFunction (*lua_CFunction)(lua_State *L) [int]\nType for C functions.\n\nIn order to communicate properly with Lua, a C function must use the\nfollowing protocol, which defines the way parameters and results are passed:\na C function receives its arguments from Lua in its stack in direct order\n(the first argument is pushed first). So, when the function starts,\n`lua_gettop(L)` returns the number of arguments received by the function.\nThe first argument (if any) is at index 1 and its last argument is at index\n`lua_gettop(L)`. To return values to Lua, a C function just pushes them onto\nthe stack, in direct order (the first result is pushed first), and returns in C\nthe number of results. Any other value in the stack below the results will\nbe properly discarded by Lua. Like a Lua function, a C function called by\nLua can also return many results.\n\nAs an example, the following function receives a variable number of numerical\narguments and returns their average and their sum:\n\n static int foo (lua_State *L) {\n int n = lua_gettop(L); /* number of arguments */\n lua_Number sum = 0.0;\n int i;\n for (i = 1; i <= n; i++) {\n if (!lua_isnumber(L, i)) {\n lua_pushliteral(L, "incorrect argument");\n lua_error(L);\n }\n sum += lua_tonumber(L, i);\n }\n lua_pushnumber(L, sum/n); /* first result */\n lua_pushnumber(L, sum); /* second result */\n return 2; /* number of results */\n }\n
+lua_checkstack lua_checkstack(lua_State *L, int n) [int]\nEnsures that the stack has space for at least `n` extra slots, that is, that you\ncan safely push up to `n` values onto it.\nIt returns false if it cannot fulfill the request, either because it would cause\nthe stack to be greater than a fixed maximum size (typically at least several\nthousand elements) or because it cannot allocate memory for the extra space.\nThis function never shrinks the stack; if the stack already has space for the\nextra slots, it is left unchanged.\n
+lua_close lua_close(lua_State *L) [void]\nClose all active to-be-closed variables in the main thread, release all objects\nin the given Lua state (calling the corresponding garbage-collection\nmetamethods, if any), and frees all dynamic memory used by this state.\n\nOn several platforms, you may not need to call this function, because all\nresources are naturally released when the host program ends. On the other hand,\nlong-running programs that create multiple states, such as daemons or web\nservers, will probably need to close states as soon as they are not needed.\n
lua_compare lua_compare(lua_State *L, int index1, int index2, int op) [int]\nCompares two Lua values.\nReturns 1 if the value at index `index1` satisfies `op` when compared with\nthe value at index `index2`, following the semantics of the corresponding Lua\noperator (that is, it may call metamethods). Otherwise returns 0. Also\nreturns 0 if any of the indices is not valid.\n\nThe value of `op` must be one of the following constants:\n * LUA_OPEQ: compares for equality (`==`)\n * LUA_OPLT: compares for less than (`<`)\n * LUA_OPLE: compares for less or equal (`<=`)\n
-lua_concat lua_concat(lua_State *L, int n) [void]\nConcatenates the `n` values at the top of the stack, pops them, and leaves\nthe result at the top. If `n` is 1, the result is the single value on the\nstack (that is, the function does nothing); if `n` is 0, the result is the\nempty string. Concatenation is performed following the usual semantics of\nLua (see §3.4.6).\n
+lua_concat lua_concat(lua_State *L, int n) [void]\nConcatenates the `n` values on the top of the stack, pops them, and leaves\nthe result at the top. If `n` is 1, the result is the single value on the\nstack (that is, the function does nothing); if `n` is 0, the result is the\nempty string. Concatenation is performed following the usual semantics of\nLua (see §3.4.6).\n
lua_copy lua_copy(lua_State *L, int fromidx, int toidx) [void]\nCopies the element at index `fromidx` into the valid index `toidx`, replacing\nthe value at that position. Values at other positions are not affected.\n
-lua_createtable lua_createtable(lua_State *L, int narr, int nrec) [void]\nCreates a new empty table and pushes it onto the stack. Parameter `narr` is a\nhint for how many elements the table will have as a sequence; parameter `nrec`\nis a hint for how many other elements the table will have. Lua may use these\nhints to preallocate memory for the new table. This preallocation is useful for\nperformance when you know in advance how many elements the table will have.\nOtherwise you can use the function `lua_newtable`.\n
+lua_createtable lua_createtable(lua_State *L, int narr, int nrec) [void]\nCreates a new empty table and pushes it onto the stack. Parameter `narr` is a\nhint for how many elements the table will have as a sequence; parameter `nrec`\nis a hint for how many other elements the table will have. Lua may use these\nhints to preallocate memory for the new table. This preallocation may help\nperformance when you know in advance how many elements the table will have.\nOtherwise you can use the function `lua_newtable`.\n
lua_dump lua_dump(lua_State *L, lua_Writer writer, void *data, int strip) [int]\nDumps a function as a binary chunk. Receives a Lua function on the top of\nthe stack and produces a binary chunk that, if loaded again, results in a\nfunction equivalent to the one dumped. As it produces parts of the chunk,\n`lua_dump` calls function `writer` (see `lua_Writer`) with the given `data`\nto write them.\n\nIf `strip` is true, the binary representation is created without debug\ninformation about the function.\n\nThe value returned is the error code returned by the last call to the writer;\n0 means no errors.\n\nThis function does not pop the Lua function from the stack.\n
-lua_error lua_error(lua_State *L) [int]\nGenerates a Lua error, using the value at the top of the stack as the error\nobject. This function does a long jump, and therefore never returns\n(see `luaL_error`).\n
-lua_gc lua_gc(lua_State *L, int what, int data) [int]\nControls the garbage collector.\n\nThis function performs several tasks, according to the value of the parameter\n`what`:\n * LUA_GCSTOP: stops the garbage collector.\n * LUA_GCRESTART: restarts the garbage collector.\n * LUA_GCCOLLECT: performs a full garbage-collection cycle.\n * LUA_GCCOUNT: returns the current amount of memory (in Kbytes) in use by Lua.\n * LUA_GCCOUNTB: returns the remainder of dividing the current amount of bytes\n of memory in use by Lua by 1024.\n * LUA_GCSTEP: performs an incremental step of garbage collection.\n * LUA_GCSETPAUSE: sets `data` as the new value for the _pause_ of the\n collector (see §2.5) and returns the previous value of the pause.\n * LUA_GCSETSTEPMUL: sets `data` as the new value for the _step multiplier_ of\n the collector (see §2.5) and returns the previous value of the step\n multiplier.\n * LUA_GCISRUNNING: returns a boolean that tells whether the collector is\n running (i.e., not stopped).\n\nFor more details about these options, see `collectgarbage`.\n
+lua_error lua_error(lua_State *L) [int]\nRaises a Lua error, using the value on the top of the stack as the error\nobject. This function does a long jump, and therefore never returns\n(see `luaL_error`).\n
+lua_gc lua_gc(lua_State *L, int what, ...) [int]\nControls the garbage collector.\n\nThis function performs several tasks, according to the value of the parameter\n`what`. For options that need extra arguments, they are listed after the\noption.\n\n * LUA_GCCOLLECT: Performs a full garbage-collection cycle.\n * LUA_GCSTOP: Stops the garbage collector.\n * LUA_GCRESTART: Restarts the garbage collector.\n * LUA_GCCOUNT: Returns the current amount of memory (in Kbytes) in use by Lua.\n * LUA_GCCOUNTB: Returns the remainder of dividing the current amount of bytes\n of memory in use by Lua by 1024.\n * LUA_GCSTEP `(int stepsize)`: Performs an incremental step of garbage\n collection\n * LUA_GCISRUNNING: Returns a boolean that tells whether the collector is\n running (i.e., not stopped).\n * LUA_GCINC (int pause, int stepmul, stepsize): Changes the collector to\n incremental mode with the given parameters (see §2.5.1). Returns the\n previous mode (`LUA_GCGEN` or `LUA_GCINC`).\n * LUA_GCGEN (int minomul, int majormul): Changes the collector to generational\n mode with the given parameters (see §2.5.2). Returns the previous mode \n (`LUA_GCGEN` or `LUA_GCINC`).\n\nFor more details about these options, see `collectgarbage`.\n
lua_getallocf lua_getallocf(lua_State *L, void **ud) [lua_Alloc]\nReturns the memory-allocation function of a given state. If `ud` is not\n`NULL`, Lua stores in `*ud` the opaque pointer given when the memory-allocator\nfunction was set.\n
lua_getextraspace lua_getextraspace(lua_State *L) [void*]\nReturns a pointer to a raw memory area associated with the given Lua state.\nThe application can use this area for any purpose; Lua does not use it for\nanything.\n\nEach new thread has this area initialized with a copy of the area of the main\nthread.\n\nBy default, this area has the size of a pointer to void, but you can recompile\nLua with a different size for this area. (See `LUA_EXTRASPACE` in `luaconf.h`.)\n
lua_getfield lua_getfield(lua_State *L, int index, const char *k) [int]\nPushes onto the stack the value `t[k]`, where `t` is the value at the given\nindex. As in Lua, this function may trigger a metamethod for the "index"\nevent (see §2.4).\n\nReturns the type of the pushed value.\n
lua_getglobal lua_getglobal(lua_State *L, const char *name) [int]\nPushes onto the stack the value of the global `name`.\nReturns the type of that value.\n
lua_geti lua_geti(lua_State *L, int index, lua_Integer i) [int]\nPushes onto the stack the value `t[i]`, where `t` is the value at the given\nindex. As in Lua, this function may trigger a metamethod for the "index" event\n(see §2.4).\n\nReturns the type of the pushed value.\n
lua_getmetatable lua_getmetatable(lua_State *L, int index) [int]\nIf the value at the given index has a metatable, the function pushes that\nmetatable onto the stack and returns 1. Otherwise, the function returns 0 and\npushes nothing on the stack.\n
-lua_gettable lua_gettable(lua_State *L, int index) [int]\nPushes onto the stack the value `t[k]`, where `t` is the value at the given\nindex and `k` is the value at the top of the stack.\n\nThis function pops the key from the stack, pushing the resulting value\nin its place. As in Lua, this function may trigger a metamethod for the\n"index" event (see §2.4).\n\nReturns the type of the pushed value.\n
+lua_gettable lua_gettable(lua_State *L, int index) [int]\nPushes onto the stack the value `t[k]`, where `t` is the value at the given\nindex and `k` is the value on the top of the stack.\n\nThis function pops the key from the stack, pushing the resulting value\nin its place. As in Lua, this function may trigger a metamethod for the\n"index" event (see §2.4).\n\nReturns the type of the pushed value.\n
lua_gettop lua_gettop(lua_State *L) [int]\nReturns the index of the top element in the stack. Because indices start at 1,\nthis result is equal to the number of elements in the stack; in particular, 0\nmeans an empty stack.\n
-lua_getuservalue lua_getuservalue(lua_State *L, int index) [int]\nPushes onto the stack the Lua value associated with the userdata at the given\nindex. This Lua value must be a table or nil.\n\nReturns the type of the pushed value.\n
+lua_getiuservalue lua_getiuservalue(lua_State *L, int index, int n) [int]\nPushes onto the stack the `n`-th user value associated with the full userdata at\nthe given index and returns the type of the pushed value.\n\nIf the userdata does not have that value, pushes `nil` and returns `LUA_TNONE`.\n
lua_insert lua_insert(lua_State *L, int index) [void]\nMoves the top element into the given valid index, shifting up the elements\nabove this index to open space. This function cannot be called with a\npseudo-index, because a pseudo-index is not an actual stack position.\n
-lua_Integer lua_Integer [typedef ... lua_Integer]\nThe type of integers in Lua.\n\nBy default this type is `long long`, (usually a 64-bit two-complement integer),\nbut that can be changed to `long` or `int` (usually a 32-bit two-complement\ninteger). (See `LUA_INT` in `luaconf.h`.)\n\nLua also defines the constants `LUA_MININTEGER` and `LUA_MAXINTEGER`, with the\nminimum and the maximum values that fit in this type.\n
+lua_Integer lua_Integer [typedef ... lua_Integer]\nThe type of integers in Lua.\n\nBy default this type is `long long`, (usually a 64-bit two-complement integer),\nbut that can be changed to `long` or `int` (usually a 32-bit two-complement\ninteger). (See `LUA_INT` in `luaconf.h`.)\n\nLua also defines the constants `LUA_MININTEGER` and `LUA_MAXINTEGER`, with the\nminimum and the maximum values that fit in this type.\n
lua_isboolean lua_isboolean(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a boolean, and 0 otherwise.\n
lua_iscfunction lua_iscfunction(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a C function, and 0 otherwise.\n
lua_isfunction lua_isfunction(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a function (either C or Lua),\nand 0 otherwise.\n
-lua_isinteger lua_isinteger(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is an integer (that is, the value is a\nnumber and is represented as an integer), and 0 otherwise. \n
+lua_isinteger lua_isinteger(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is an integer (that is, the value is a\nnumber and is represented as an integer), and 0 otherwise.\n
lua_islightuserdata lua_islightuserdata(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a light userdata, and 0 otherwise.\n
lua_isnil lua_isnil(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is nil, and 0 otherwise.\n
lua_isnone lua_isnone(lua_State *L, int index) [int]\nReturns 1 if the given index is not valid, and 0 otherwise.\n
@@ -40,152 +40,164 @@ lua_isthread lua_isthread(lua_State *L, int index) [int]\nReturns 1 if the value
lua_isuserdata lua_isuserdata(lua_State *L, int index) [int]\nReturns 1 if the value at the given index is a userdata (either full or\nlight), and 0 otherwise.\n
lua_isyieldable lua_isyieldable(lua_State *L) [int]\nReturns 1 if the given coroutine can yield, and 0 otherwise.\n
lua_KContext lua_KContext [typedef ... lua_KContext]\nThe type for continuation-function contexts. It must be a numerical type. This\ntype is defined as `intptr_t` when `intptr_t` is available, so that it can store\npointers too. Otherwise, it is defined as `ptrdiff_t`.\n
-lua_KFunction lua_KFunction [int (*)(lua_State *L, int status, lua_KContext ctx)]\nType for continuation functions (see §4.7).\n
+lua_KFunction lua_KFunction [int (*)(lua_State *L, int status, lua_KContext ctx)]\nType for continuation functions (see §4.5).\n
lua_len lua_len(lua_State *L, int index) [void]\nReturns the length of the value at the given index. It is equivalent to the\n'`#`' operator in Lua (see §3.4.7) and may trigger a metamethod for the "length"\nevent (see §2.4). The result is pushed on the stack.\n
-lua_load lua_load(lua_State *L, lua_Reader reader, void *data, const char *chunkname, const char *mode) [int]\nLoads a Lua chunk without running it. If there are no errors, `lua_load`\npushes the compiled chunk as a Lua function on top of the stack. Otherwise, it\npushes an error message.\n\nThe return values of `lua_load` are:\n * LUA_OK: no errors;\n * LUA_ERRSYNTAX: syntax error during pre-compilation;\n * LUA_ERRMEM: memory allocation (out-of-memory) error.\n * LUA_ERRGCMM: error while running a `__gc` metamethod. (This error has no\n relation with the chunk being loaded. It is generated by the garbage\n collector.)\n\nThe `lua_load` function uses a user-supplied `reader` function to read the chunk\n(see `lua_Reader`). The `data` argument is an opaque value passed to the reader\nfunction.\n\nThe `chunkname` argument gives a name to the chunk, which is used for error\nmessages and in debug information (see §4.9).\n\n`lua_load` automatically detects whether the chunk is text or binary and loads\nit accordingly (see program `luac`). The string `mode` works as in function\n`load`, with the addition that a `NULL` value is equivalent to the string\n"`bt`".\n\n`lua_load` uses the stack internally, so the reader function must always\nleave the stack unmodified when returning.\n\nIf the resulting function has upvalues, its first upvalue is set to the value of\nthe global environment stored at index `LUA_RIDX_GLOBALS` in the registry\n(see §4.5). When loading main chunks, this upvalue will be the `_ENV` variable\n(see §2.2). Other upvalues are initialized with `nil`.\n
-lua_newstate lua_newstate(lua_Alloc f, void *ud) [lua_State*]\nCreates a new thread running in a new, independent state. Returns `NULL` if it\ncannot create the thread or the state (due to lack of memory). The argument `f`\nis the allocator function; Lua does all memory allocation for this state through\nthis function. The second argument, `ud`, is an opaque pointer that Lua passes\nto the allocator in every call.\n
+lua_load lua_load(lua_State *L, lua_Reader reader, void *data, const char *chunkname, const char *mode) [int]\nLoads a Lua chunk without running it. If there are no errors, `lua_load`\npushes the compiled chunk as a Lua function on top of the stack. Otherwise, it\npushes an error message.\n\nThe `lua_load` function uses a user-supplied `reader` function to read the chunk\n(see `lua_Reader`). The `data` argument is an opaque value passed to the reader\nfunction.\n\nThe `chunkname` argument gives a name to the chunk, which is used for error\nmessages and in debug information (see §4.7).\n\n`lua_load` automatically detects whether the chunk is text or binary and loads\nit accordingly (see program `luac`). The string `mode` works as in function\n`load`, with the addition that a `NULL` value is equivalent to the string\n"`bt`".\n\n`lua_load` uses the stack internally, so the reader function must always\nleave the stack unmodified when returning.\n\n`lua_load` can return `LUA_OK`, `LUA_ERRSYNTAX`, or `LUA_ERRMEM`. The function \nmay also return other values corresponding to errors raised by the read function\n(see §4.4.1).\n\nIf the resulting function has upvalues, its first upvalue is set to the value of\nthe global environment stored at index `LUA_RIDX_GLOBALS` in the registry\n(see §4.3). When loading main chunks, this upvalue will be the `_ENV` variable\n(see §2.2). Other upvalues are initialized with `nil`.\n
+lua_newstate lua_newstate(lua_Alloc f, void *ud) [lua_State*]\nCreates a new independent state and returns its main thread. Returns `NULL` if \nit cannot create the thread or the state (due to lack of memory). The argument \n`f` is the allocator function; Lua will do all memory allocation for this state \nthrough this function. The second argument, `ud`, is an opaque pointer that Lua \npasses to the allocator in every call.\n
lua_newtable lua_newtable(lua_State *L) [void]\nCreates a new empty table and pushes it onto the stack. It is equivalent to\n`lua_createtable(L, 0, 0)`.\n
-lua_newthread lua_newthread(lua_State *L) [lua_State*]\nCreates a new thread, pushes it on the stack, and returns a pointer to a\n`lua_State` that represents this new thread. The new thread returned by this\nfunction shares with the original thread its global environment, but has an\nindependent execution stack.\n\nThere is no explicit function to close or to destroy a thread. Threads are\nsubject to garbage collection, like any Lua object.\n
-lua_newuserdata lua_newuserdata(lua_State *L, size_t size) [void*]\nThis function allocates a new block of memory with the given size, pushes onto\nthe stack a new full userdata with the block address, and returns this address.\nThe host program can freely use this memory.\n
-lua_next lua_next(lua_State *L, int index) [int]\n\nPops a key from the stack, and pushes a key-value pair from the table at\nthe given index (the "next" pair after the given key). If there are no more\nelements in the table, then `lua_next` returns 0 (and pushes nothing).\n\nA typical traversal looks like this:\n\n /* table is in the stack at index 't' */\n lua_pushnil(L); /* first key */\n while (lua_next(L, t) != 0) {\n /* uses 'key' (at index -2) and 'value' (at index -1) */\n printf("%s - %s\\n",\n lua_typename(L, lua_type(L, -2)),\n lua_typename(L, lua_type(L, -1)));\n /* removes 'value'; keeps 'key' for next iteration */\n lua_pop(L, 1);\n }\n\nWhile traversing a table, do not call `lua_tolstring` directly on a key, unless\nyou know that the key is actually a string. Recall that `lua_tolstring` may\nchange the value at the given index; this confuses the next call to `lua_next`.\n\nSee function `next` for the caveats of modifying the table during its traversal.\n
+lua_newthread lua_newthread(lua_State *L) [lua_State*]\nCreates a new thread, pushes it on the stack, and returns a pointer to a\n`lua_State` that represents this new thread. The new thread returned by this\nfunction shares with the original thread its global environment, but has an\nindependent execution stack.\n\nThreads are subject to garbage collection, like any Lua object.\n
+lua_newuserdatauv lua_newuserdatauv(lua_State *L, size_t size, int nuvalue) [void*]\nThis function creates and pushes on the stack a new full userdata, with \n`nuvalue` associated Lua values, called *user values*, plus an associated block \nof raw memory with `size` bytes. (The user values can be set and read with the \nfunctions `lua_setiuservalue` and `lua_getiuservalue`.)\n\nThe function returns the address of the block of memory. Lua ensures that this \naddress is valid as long as the corresponding userdata is alive (see §2.5).\nMoreover, if the userdata is marked for finalization (see §2.5.3), its address \nis valid at least until the call to its finalizer.\n
+lua_next lua_next(lua_State *L, int index) [int]\n\nPops a key from the stack, and pushes a key-value pair from the table at\nthe given index, the "next" pair after the given key. If there are no more\nelements in the table, then `lua_next` returns 0 and pushes nothing.\n\nA typical table traversal looks like this:\n\n /* table is in the stack at index 't' */\n lua_pushnil(L); /* first key */\n while (lua_next(L, t) != 0) {\n /* uses 'key' (at index -2) and 'value' (at index -1) */\n printf("%s - %s\\n",\n lua_typename(L, lua_type(L, -2)),\n lua_typename(L, lua_type(L, -1)));\n /* removes 'value'; keeps 'key' for next iteration */\n lua_pop(L, 1);\n }\n\nWhile traversing a table, avoid calling `lua_tolstring` directly on a key, \nunless you know that the key is actually a string. Recall that `lua_tolstring` \nmay change the value at the given index; this confuses the next call to \n`lua_next`.\n\nThis function may raise an error if the given key is neither nil nor present in \nthe table. See function `next` for the caveats of modifying the table during \nits traversal.\n
lua_Number lua_Number [double]\nThe type of floats in Lua. By default this type is double, but that can be\nchanged to a single float. (See `LUA_REAL` in `luaconf.h`.)\n
-lua_numbertointeger lua_numbertointeger(lua_Number n, lua_Integer *p) [int]\nConverts a Lua float to a Lua integer. This macro assumes that `n` has an\nintegral value. If that value is within the range of Lua integers, it is\nconverted to an integer and assigned to `*p`. The macro results in a boolean\nindicating whether the conversion was successful. (Note that this range test\ncan be tricky to do correctly without this macro, due to roundings.)\n\nThis macro may evaluate its arguments more than once.\n
-lua_pcall lua_pcall(lua_State *L, int nargs, int nresults, int msgh) [int]\nCalls a function in protected mode.\n\nBoth `nargs` and `nresults` have the same meaning as in `lua_call`. If there\nare no errors during the call, `lua_pcall` behaves exactly like `lua_call`.\nHowever, if there is any error,\n\n`lua_pcall` catches it, pushes a single value on the stack (the error object),\nand returns an error code. Like `lua_call`, `lua_pcall` always removes the\nfunction and its arguments from the stack.\n\nIf `msgh` is 0, then the error object returned on the stack is exactly the\noriginal error object. Otherwise, `msgh` is the stack index of a _message\nhandler_. (In the current implementation, this index cannot be a pseudo-index.)\nIn case of runtime errors, this function will be called with the error object\nand its return value will be the object returned on the stack by `lua_pcall`.\n\nTypically, the message handler is used to add more debug information to the\nerror object, such as a stack traceback. Such information cannot be gathered\nafter the return of `lua_pcall`, since by then the stack has unwound.\n\nThe `lua_pcall` function returns one of the following constants (defined in\n`lua.h`):\n * LUA_OK (0): success.\n * LUA_ERRRUN: a runtime error.\n * LUA_ERRMEM: memory allocation error. For such errors, Lua does not call the\n message handler.\n * LUA_ERRERR: error while running the message handler.\n * LUA_ERRGCMM: error while running a `__gc` metamethod. (This error typically\n has no relation with the function being called.)\n
-lua_pcallk lua_pcallk(lua_State *L, int nargs, int nresults, int msgh, lua_KContext ctx, lua_KFunction k) [int]\nThis function behaves exactly like `lua_pcall`, but allows the called function\nto yield (see §4.7).\n
-lua_pop lua_pop(lua_State *L, int n) [void]\nPops `n` elements from the stack.\n
+lua_numbertointeger lua_numbertointeger(lua_Number n, lua_Integer *p) [int]\nTries to convert a Lua float to a Lua integer; the float `n` must have an\nintegral value. If that value is within the range of Lua integers, it is\nconverted to an integer and assigned to `*p`. The macro results in a boolean\nindicating whether the conversion was successful. (Note that this range test\ncan be tricky to do correctly without this macro, due to rounding.)\n\nThis macro may evaluate its arguments more than once.\n
+lua_pcall lua_pcall(lua_State *L, int nargs, int nresults, int msgh) [int]\nCalls a function (or a callable object) in protected mode.\n\nBoth `nargs` and `nresults` have the same meaning as in `lua_call`. If there\nare no errors during the call, `lua_pcall` behaves exactly like `lua_call`.\nHowever, if there is any error,\n\n`lua_pcall` catches it, pushes a single value on the stack (the error object),\nand returns an error code. Like `lua_call`, `lua_pcall` always removes the\nfunction and its arguments from the stack.\n\nIf `msgh` is 0, then the error object returned on the stack is exactly the\noriginal error object. Otherwise, `msgh` is the stack index of a _message\nhandler_. (In the current implementation, this index cannot be a pseudo-index.)\nIn case of runtime errors, this handler will be called with the error object\nand its return value will be the object returned on the stack by `lua_pcall`.\n\nTypically, the message handler is used to add more debug information to the\nerror object, such as a stack traceback. Such information cannot be gathered\nafter the return of `lua_pcall`, since by then the stack has unwound.\n\nThe `lua_pcall` function returns one of the following status codes: `LUA_OK`,\n`LUA_ERRRUN`, `LUA_ERRMEM`, or `LUA_ERRERR`.\n
+lua_pcallk lua_pcallk(lua_State *L, int nargs, int nresults, int msgh, lua_KContext ctx, lua_KFunction k) [int]\nThis function behaves exactly like `lua_pcall`, except that it allows the called \nfunction to yield (see §4.5).\n
+lua_pop lua_pop(lua_State *L, int n) [void]\nPops `n` elements from the stack.\n\nThis function can run arbitrary code when removing an index marked as \nto-be-closed from the stack.\n
lua_pushboolean lua_pushboolean(lua_State *L, int b) [void]\nPushes a boolean value with value `b` onto the stack.\n
-lua_pushcclosure lua_pushcclosure(lua_State *L, lua_CFunction fn, int n) [void]\nPushes a new C closure onto the stack.\n\nWhen a C function is created, it is possible to associate some values with it,\nthus creating a C closure (see §4.4); these values are then accessible to\nthe function whenever it is called. To associate values with a C function,\nfirst these values must be pushed onto the stack (when there are multiple\nvalues, the first value is pushed first). Then `lua_pushcclosure` is called to\ncreate and push the C function onto the stack, with the argument `n` telling\nhow many values will be associated with the function. `lua_pushcclosure`\nalso pops these values from the stack.\n\nThe maximum value for `n` is 255.\n\nWhen `n` is zero, this function creates a _light C function_, which is just a\npointer to the C function. In that case, it never raises a memory error.\n
-lua_pushcfunction lua_pushcfunction(lua_State *L, lua_CFunction f) [void]\nPushes a C function onto the stack. This function receives a pointer to a\nC function and pushes onto the stack a Lua value of type `function` that,\nwhen called, invokes the corresponding C function.\n\nAny function to be registered in Lua must follow the correct protocol to\nreceive its parameters and return its results (see `lua_CFunction`).\n\n`lua_pushcfunction` is defined as a macro:\n\n #define lua_pushcfunction(L,f) lua_pushcclosure(L,f,0)\n
-lua_pushfstring lua_pushfstring(lua_State *L, const char *fmt, ...) [const char*]\nPushes onto the stack a formatted string and returns a pointer to this string.\nIt is similar to the ISO C function `sprintf`, but has some important\ndifferences:\n * You do not have to allocate space for the result: the result is a\n Lua string and Lua takes care of memory allocation (and deallocation,\n through garbage collection).\n * The conversion specifiers are quite restricted. There are no flags,\n widths, or precisions. The conversion specifiers can only be '%%'\n (inserts the character '%' in the string), '%s' (inserts a zero-terminated\n string, with no size restrictions), '%f' (inserts a `lua_Number`), '%L'\n (inserts a `lua_Integer`), '%p' (inserts a pointer as a hexadecimal\n numeral), '%d' (inserts an `int`), '%c' (inserts an `int` as a one-byte\n character), and '%U' (inserts a `long int` as a UTF-8 byte sequence).\n \nUnlike other push functions, this function checks for the stack space it needs,\nincluding the slot for its result.\n
+lua_pushcclosure lua_pushcclosure(lua_State *L, lua_CFunction fn, int n) [void]\nPushes a new C closure onto the stack.\n\nThis function receives a pointer to a C function and pushes onto the stack a Lua \nvalue of type `function` that, when called, invokes the corresponding \nC function. The parameter `n` tells how many upvalues this function will have\n(see §4.2).\n\nAny function to be callable by Lua must follow the correct protocol to receive \nits parameters and return its results (see `lua_CFunction`).\n\nWhen a C function is created, it is possible to associate some values with it,\nthe so called upvalues; these upvalues are then accessible to the function \nwhenever it is called. This association is called a C closure (see §4.2). To \ncreate a C closure, first the initial values for its upvalues must be pushed \nonto the stack. (When there are multiple values, the first value is pushed \nfirst.) Then `lua_pushcclosure` is called to create and push the C function \nonto the stack, with the argument `n` telling how many values will be associated \nwith the function. `lua_pushcclosure` also pops these values from the stack.\n\nThe maximum value for `n` is 255.\n\nWhen `n` is zero, this function creates a _light C function_, which is just a\npointer to the C function. In that case, it never raises a memory error.\n
+lua_pushcfunction lua_pushcfunction(lua_State *L, lua_CFunction f) [void]\nPushes a C function onto the stack. This function is equivalent to \n`lua_pushcclosure` with no upvalues.\n
+lua_pushfstring lua_pushfstring(lua_State *L, const char *fmt, ...) [const char*]\nPushes onto the stack a formatted string and returns a pointer to this string\n(see §4.1.3). It is similar to the ISO C function `sprintf`, but has two\nimportant differences. First, you do not have to allocate space for the result; \nthe result is a Lua string and Lua takes care of memory allocation (and \ndeallocation, through garbage collection). Second, the conversion specifiers \nare quite restricted. There are no flags, widths, or precisions. The \nconversion specifiers can only be '%%' (inserts the character '%' in the \nstring), '%s' (inserts a zero-terminated string, with no size restrictions), \n'%f' (inserts a `lua_Number`), '%L' (inserts a `lua_Integer`), '%p' (inserts a \npointer as a hexadecimal numeral), '%d' (inserts an `int`), '%c' (inserts an \n`int` as a one-byte character), and '%U' (inserts a `long int` as a UTF-8 byte \nsequence).\n \nThis function may raise errors due to memory overflow or an invalid conversion \nspecifier.\n
lua_pushglobaltable lua_pushglobaltable(lua_State *L) [void]\nPushes the global environment onto the stack.\n
lua_pushinteger lua_pushinteger(lua_State *L, lua_Integer n) [void]\nPushes an integer with value `n` onto the stack.\n
lua_pushlightuserdata lua_pushlightuserdata(lua_State *L, void *p) [void]\nPushes a light userdata onto the stack.\n\nUserdata represent C values in Lua. A _light userdata_ represents a pointer, a\n`void*`. It is a value (like a number): you do not create it, it has no\nindividual metatable, and it is not collected (as it was never created). A\nlight userdata is equal to "any" light userdata with the same C address.\n
-lua_pushliteral lua_pushliteral(lua_State *L, const char *s) [const char*]\nThis macro is equivalent to `lua_pushlstring`, but can be used only when `s` is\na literal string. It automatically provides the string length.\n
-lua_pushlstring lua_pushlstring(lua_State *L, const char *s, size_t len) [const char*]\nPushes the string pointed to by `s` with size `len` onto the stack. Lua makes\n(or reuses) an internal copy of the given string, so the memory at `s` can\nbe freed or reused immediately after the function returns. The string can\ncontain any binary data, including embedded zeros.\n\nReturns a pointer to the internal copy of the string.\n
+lua_pushliteral lua_pushliteral(lua_State *L, const char *s) [const char*]\nThis macro is equivalent to `lua_pushlstring`, but can be used only when `s` is\na literal string. (Lua may optimize this case.)\n
+lua_pushlstring lua_pushlstring(lua_State *L, const char *s, size_t len) [const char*]\nPushes the string pointed to by `s` with size `len` onto the stack. Lua will\nmake or reuse an internal copy of the given string, so the memory at `s` can\nbe freed or reused immediately after the function returns. The string can\ncontain any binary data, including embedded zeros.\n\nReturns a pointer to the internal copy of the string (see §4.1.3).\n
lua_pushnil lua_pushnil(lua_State *L) [void]\nPushes a nil value onto the stack.\n
lua_pushnumber lua_pushnumber(lua_State *L, lua_Number n) [void]\nPushes a float with value `n` onto the stack.\n
-lua_pushstring lua_pushstring(lua_State *L, const char *s) [const char*]\nPushes the zero-terminated string pointed to by `s` onto the stack. Lua makes\n(or reuses) an internal copy of the given string, so the memory at `s`\ncan be freed or reused immediately after the function returns. The string\ncannot contain embedded zeros; it is assumed to end at the first zero.\n\nReturns a pointer to the internal copy of the string.\n\nIf `s` is `NULL`, pushes nil and returns `NULL`.\n
+lua_pushstring lua_pushstring(lua_State *L, const char *s) [const char*]\nPushes the zero-terminated string pointed to by `s` onto the stack. Lua will\nmake or reuse an internal copy of the given string, so the memory at `s`\ncan be freed or reused immediately after the function returns. The string\ncannot contain embedded zeros; it is assumed to end at the first zero.\n\nReturns a pointer to the internal copy of the string (see §4.1.3).\n\nIf `s` is `NULL`, pushes nil and returns `NULL`.\n
lua_pushthread lua_pushthread(lua_State *L) [int]\nPushes the thread represented by `L` onto the stack. Returns 1 if this\nthread is the main thread of its state.\n
lua_pushvalue lua_pushvalue(lua_State *L, int index) [void]\nPushes a copy of the element at the given index onto the stack.\n
lua_pushvfstring lua_pushvfstring(lua_State *L, const char *fmt, va_list argp) [const char*]\nEquivalent to `lua_pushfstring`, except that it receives a `va_list` instead\nof a variable number of arguments.\n
-lua_rawequal lua_rawequal(lua_State *L, int index1, int index2) [int]\nReturns 1 if the two values in indices `index1` and `index2` are primitively\nequal (that is, without calling the `__eq` metamethod). Otherwise returns 0.\nAlso returns 0 if any of the indices are not valid.\n
+lua_rawequal lua_rawequal(lua_State *L, int index1, int index2) [int]\nReturns 1 if the two values in indices `index1` and `index2` are primitively\nequal (that is, equal without calling the `__eq` metamethod). Otherwise returns \n0. Also returns 0 if any of the indices are not valid.\n
lua_rawget lua_rawget(lua_State *L, int index) [int]\nSimilar to `lua_gettable`, but does a raw access (i.e., without metamethods).\n
-lua_rawgeti lua_rawgeti(lua_State *L, int index, lua_Integer n) [int]\nPushes onto the stack the value `t[n]`, where `t` is the table at the given\nindex. The access is raw, that is, it does not invoke the `__index` metamethod.\n\nReturns the type of the pushed value.\n
-lua_rawgetp lua_rawgetp(lua_State *L, int index, const void *p) [int]\nPushes onto the stack the value `t[k]`, where `t` is the table at the given\nindex and `k` is the pointer `p` represented as a light userdata. The access\nis raw, that is, it does not invoke the `__index` metamethod.\n\nReturns the type of the pushed value.\n
-lua_rawlen lua_rawlen(lua_State *L, int index) [size_t]\nReturns the raw "length" of the value at the given index: for strings, this\nis the string length; for tables, this is the result of the length operator\n('`#`') with no metamethods; for userdata, this is the size of the block of\nmemory allocated for the userdata; for other values, it is 0.\n
+lua_rawgeti lua_rawgeti(lua_State *L, int index, lua_Integer n) [int]\nPushes onto the stack the value `t[n]`, where `t` is the table at the given\nindex. The access is raw, that is, it does not use the `__index` metavalue.\n\nReturns the type of the pushed value.\n
+lua_rawgetp lua_rawgetp(lua_State *L, int index, const void *p) [int]\nPushes onto the stack the value `t[k]`, where `t` is the table at the given\nindex and `k` is the pointer `p` represented as a light userdata. The access\nis raw, that is, it does not use the `__index` metavalue.\n\nReturns the type of the pushed value.\n
+lua_rawlen lua_rawlen(lua_State *L, int index) [lua_Unsigned]\nReturns the raw "length" of the value at the given index: for strings, this\nis the string length; for tables, this is the result of the length operator\n('`#`') with no metamethods; for userdata, this is the size of the block of\nmemory allocated for the userdata. For other values, this call returns 0.\n
lua_rawset lua_rawset(lua_State *L, int index) [void]\nSimilar to `lua_settable`, but does a raw assignment (i.e., without\nmetamethods).\n
-lua_rawseti lua_rawseti(lua_State *L, int index, lua_Integer i) [void]\nDoes the equivalent of `t[i] = v`, where `t` is the table at the given index\nand `v` is the value at the top of the stack.\n\nThis function pops the value from the stack. The assignment is raw, that is, it\ndoes not invoke the `__newindex` metamethod.\n
-lua_rawsetp lua_rawsetp(lua_State *L, int index, const void *p) [void]\nDoes the equivalent of `t[k] = v`, where `t` is the table at the given index,\n`k` is the pointer `p` represented as a light userdata, and `v` is the value at\nthe top of the stack.\n\nThis function pops the value from the stack. The assignment is raw, that is, it\ndoes not invoke the `__newindex` metamethod.\n
-lua_Reader (*lua_Reader)(lua_State *L, void *data, size_t *size) [const char*]\nThe reader function used by `lua_load`. Every time it needs another piece of\nthe chunk, `lua_load` calls the reader, passing along its `data` parameter.\nThe reader must return a pointer to a block of memory with a new piece of\nthe chunk and set `size` to the block size. The block must exist until the\nreader function is called again. To signal the end of the chunk, the reader\nmust return `NULL` or set `size` to zero. The reader function may return\npieces of any size greater than zero.\n
+lua_rawseti lua_rawseti(lua_State *L, int index, lua_Integer i) [void]\nDoes the equivalent of `t[i] = v`, where `t` is the table at the given index\nand `v` is the value on the top of the stack.\n\nThis function pops the value from the stack. The assignment is raw, that is, it\ndoes not use the `__newindex` metavalue.\n
+lua_rawsetp lua_rawsetp(lua_State *L, int index, const void *p) [void]\nDoes the equivalent of `t[k] = v`, where `t` is the table at the given index,\n`k` is the pointer `p` represented as a light userdata, and `v` is the value on\nthe top of the stack.\n\nThis function pops the value from the stack. The assignment is raw, that is, it\ndoes not use the `__newindex` metavalue.\n
+lua_Reader (*lua_Reader)(lua_State *L, void *data, size_t *size) [const char*]\nThe reader function used by `lua_load`. Every time `lua_load` needs another \npiece of the chunk, it calls the reader, passing along its `data` parameter.\nThe reader must return a pointer to a block of memory with a new piece of\nthe chunk and set `size` to the block size. The block must exist until the\nreader function is called again. To signal the end of the chunk, the reader\nmust return `NULL` or set `size` to zero. The reader function may return\npieces of any size greater than zero.\n
lua_register lua_register(lua_State *L, const char *name, lua_CFunction f) [void]\nSets the C function `f` as the new value of global `name`. It is defined\nas a macro:\n\n #define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n))\n
lua_remove lua_remove(lua_State *L, int index) [void]\nRemoves the element at the given valid index, shifting down the elements\nabove this index to fill the gap. This function cannot be called with a\npseudo-index, because a pseudo-index is not an actual stack position.\n
lua_replace lua_replace(lua_State *L, int index) [void]\nMoves the top element into the given valid index, without shifting any element\n(therefore replacing the value at the given index), and then pops the top\nelement.\n
-lua_resume lua_resume(lua_State *L, lua_State *from, int nargs) [int]\nStarts and resumes a coroutine in a given thread.\n\nTo start a coroutine, you push onto the thread stack the main function plus any\narguments; then you call `lua_resume`, with `nargs` being the number of\narguments. This call returns when the coroutine suspends or finishes its\nexecution. When it returns, the stack contains all values passed to\n`lua_yield`, or all values returned by the body function. `lua_resume` returns\n`LUA_YIELD` if the coroutine yields, `LUA_OK` if the coroutine finishes its\nexecution without errors, or an error code in case of errors (see `lua_pcall`).\n\nIn case of errors, the stack is not unwound, so you can use the debug API over\nit. The error object is on the top of the stack.\n\nTo resume a coroutine, you remove any results from the last `lua_yield`, put on\nits stack only the values to be passed as results from `yield`, and then call\n`lua_resume`.\n\nThe parameter `from` represents the coroutine that is resuming `L`. If there\nis no such coroutine, this parameter can be `NULL`.\n
+lua_resetthread lua_resetthread(lua_State *L) [void]\nResets a thread, cleaning its call stack and closing all pending to-be-closed \nvariables. Returns a status code: `LUA_OK` for no errors in closing methods, or \nan error status otherwise. In case of error, leaves the error object on the top \nof the stack.\n
+lua_resume lua_resume(lua_State *L, lua_State *from, int nargs, int *nresults) [int]\nStarts and resumes a coroutine in the given thread `L`.\n\nTo start a coroutine, you push the main function plus any arguments onto the\nempty stack of the thread. Then you call `lua_resume`, with `nargs` being the \nnumber of arguments. This call returns when the coroutine suspends or finishes \nits execution. When it returns, `*nresults` is updated and the top of the stack \ncontains the `*nresults` values passed to `lua_yield` or returned by the body \nfunction. `lua_resume` returns `LUA_YIELD` if the coroutine yields, `LUA_OK` if \nthe coroutine finishes its execution without errors, or an error code in case of \nerrors (see §4.4.1). In case of errors, the error object is on the top of the \nstack.\n\nTo resume a coroutine, you remove the `*nresults` yielded values from its stack,\npush the values to be passed as results from `yield`, and then call\n`lua_resume`.\n\nThe parameter `from` represents the coroutine that is resuming `L`. If there\nis no such coroutine, this parameter can be `NULL`.\n
lua_rotate lua_rotate(lua_State *L, int index, int n) [void]\nRotates the stack elements from `index` to the top `n` positions in the\ndirection of the top, for a positive `n`, or `-n` positions in the direction of\nthe bottom, for a negative `n`. The absolute value of `n` must not be greater\nthan the size of the slice being rotated.\n
lua_setallocf lua_setallocf(lua_State *L, lua_Alloc f, void *ud) [void]\nChanges the allocator function of a given state to `f` with user data `ud`.\n
-lua_setfield lua_setfield(lua_State *L, int index, const char *k) [void]\nDoes the equivalent to `t[k] = v`, where `t` is the value at the given index\nand `v` is the value at the top of the stack.\n\nThis function pops the value from the stack. As in Lua, this function may\ntrigger a metamethod for the "newindex" event (see §2.4).\n
+lua_setfield lua_setfield(lua_State *L, int index, const char *k) [void]\nDoes the equivalent to `t[k] = v`, where `t` is the value at the given index\nand `v` is the value on the top of the stack.\n\nThis function pops the value from the stack. As in Lua, this function may\ntrigger a metamethod for the "newindex" event (see §2.4).\n
lua_setglobal lua_setglobal(lua_State *L, const char *name) [void]\nPops a value from the stack and sets it as the new value of global `name`.\n
-lua_seti lua_seti(lua_State *L, int index, lua_Integer n) [void]\nDoes the equivalent to `t[n] = v`, where `t` is the value at the given index and\n`v` is the value at the top of the stack.\n\nThis function pops the value from the stack. As in Lua, this function may\ntrigger a metamethod for the "newindex" event (see §2.4).\n
-lua_setmetatable lua_setmetatable(lua_State *L, int index) [void]\nPops a table from the stack and sets it as the new metatable for the value\nat the given index.\n
-lua_settable lua_settable(lua_State *L, int index) [void]\nDoes the equivalent to `t[k] = v`, where `t` is the value at the given index,\n`v` is the value at the top of the stack, and `k` is the value just below the\ntop.\n\nThis function pops both the key and the value from the stack. As in Lua,\nthis function may trigger a metamethod for the "newindex" event (see §2.4).\n
-lua_settop lua_settop(lua_State *L, int index) [void]\nAccepts any index, or 0, and sets the stack top to this index. If the new\ntop is larger than the old one, then the new elements are filled with\n**nil**. If `index` is 0, then all stack elements are removed.\n
-lua_setuservalue lua_setuservalue(lua_State *L, int index) [void]\nPops a value from the stack and sets it as the new value associated to\nthe userdata at the given index.\n
+lua_seti lua_seti(lua_State *L, int index, lua_Integer n) [void]\nDoes the equivalent to `t[n] = v`, where `t` is the value at the given index and\n`v` is the value on the top of the stack.\n\nThis function pops the value from the stack. As in Lua, this function may\ntrigger a metamethod for the "newindex" event (see §2.4).\n
+lua_setiuservalue lua_setiuservalue(lua_State *L, int index, int n) [int]\nPops a value from the stack and sets it as the new `n`-th user value associated \nto the full userdata at the given index. Returns 0 if the userdata does not \nhave that value.\n
+lua_setmetatable lua_setmetatable(lua_State *L, int index) [int]\nPops a table or nil from the stack and sets that value as the new metatable for \nthe value at the given index (nil means no metatable).\n\n(For historical reasons, this function returns an `int`, which now is always 1.)\n
+lua_settable lua_settable(lua_State *L, int index) [void]\nDoes the equivalent to `t[k] = v`, where `t` is the value at the given index,\n`v` is the value on the top of the stack, and `k` is the value just below the\ntop.\n\nThis function pops both the key and the value from the stack. As in Lua,\nthis function may trigger a metamethod for the "newindex" event (see §2.4).\n
+lua_settop lua_settop(lua_State *L, int index) [void]\nAccepts any index, or 0, and sets the stack top to this index. If the new\ntop is greater than the old one, then the new elements are filled with nil. \nIf `index` is 0, then all stack elements are removed.\n\nThis function can run arbitrary code when removing an index marked as \nto-be-closed from the stack.\n
+lua_setwarnf lua_setwarnf(lua_State *L, lua_WarnFunction f, void *ud) [void]\nSets the warning function to be used by Lua to emit warnings (see \n`lua_WarnFunction`). The `ud` parameter sets the value `ud` passed to the \nwarning function.\n
lua_State lua_State [struct lua_State]\nAn opaque structure that points to a thread and indirectly (through the thread)\nto the whole state of a Lua interpreter. The Lua library is fully reentrant: it\nhas no global variables. All information about a state is accessible through\nthis structure.\n\nA pointer to this structure must be passed as the first argument to every\nfunction in the library, except to `lua_newstate`, which creates a Lua state\nfrom scratch.\n
-lua_status lua_status(lua_State *L) [int]\nReturns the status of the thread `L`.\n\nThe status can be 0 (`LUA_OK`) for a normal thread, an error code if the thread\nfinished the execution of a `lua_resume` with an error, or `LUA_YIELD` if the\nthread is suspended.\n\nYou can only call functions in threads with status `LUA_OK`. You can resume\nthreads with status `LUA_OK` (to start a new coroutine) or `LUA_YIELD` (to\nresume a coroutine).\n
-lua_stringtonumber lua_stringtonumber(lua_State *L, const char *s) [size_t]\nConverts the zero-terminated string `s` to a number, pushes that number into the\nstack, and returns the total size of the string, that is, its length plus one.\nThe conversion can result in an integer or a float, according to the lexical\nconventions of Lua (see §3.1). The string may have leading and trailing spaces\nand a sign. If the string is not a valid numeral, returns 0 and pushes nothing.\n(Note that the result can be used as a boolean, true if the conversion\nsucceeds.)\n
+lua_status lua_status(lua_State *L) [int]\nReturns the status of the thread `L`.\n\nThe status can be `LUA_OK` for a normal thread, an error code if the thread\nfinished the execution of a `lua_resume` with an error, or `LUA_YIELD` if the\nthread is suspended.\n\nYou can call functions only in threads with status `LUA_OK`. You can resume\nthreads with status `LUA_OK` (to start a new coroutine) or `LUA_YIELD` (to\nresume a coroutine).\n
+lua_stringtonumber lua_stringtonumber(lua_State *L, const char *s) [size_t]\nConverts the zero-terminated string `s` to a number, pushes that number into the\nstack, and returns the total size of the string, that is, its length plus one.\nThe conversion can result in an integer or a float, according to the lexical\nconventions of Lua (see §3.1). The string may have leading and trailing \nwhitespaces and a sign. If the string is not a valid numeral, returns 0 and \npushes nothing. (Note that the result can be used as a boolean, true if the \nconversion succeeds.)\n
lua_toboolean lua_toboolean(lua_State *L, int index) [int]\nConverts the Lua value at the given index to a C boolean value (0 or 1).\nLike all tests in Lua, `lua_toboolean` returns true for any Lua value different\nfrom false and nil; otherwise it returns false. (If you want to accept only\nactual boolean values, use `lua_isboolean` to test the value's type.)\n
+lua_toclose lua_toclose(lua_State *L, int index) [void]\nMarks the given index in the stack as a to-be-closed "variable" (see §3.3.8).\nLike a to-be-closed variable in Lua, the value at that index in the stack will \nbe closed when it goes out of scope. Here, in the context of a C function, to \ngo out of scope means that the running function returns to Lua, there is an \nerror, or the index is removed from the stack through `lua_settop` or `lua_pop`.\nAn index marked as to-be-closed should not be removed from the stack by any \nother function in the API except `lua_settop` or `lua_pop`.\n\nThis function should not be called for an index that is equal to or below an \nactive to-be-closed index.\n\nIn the case of an out-of-memory error, the value in the given index is \nimmediately closed, as if it was already marked.\n\nNote that, both in case of errors and of a regular return, by the time the \n`__close` metamethod runs, the C stack was already unwound, so that any \nautomatic C variable declared in the calling function will be out of scope.\n
lua_tocfunction lua_tocfunction(lua_State *L, int index) [lua_CFunction]\nConverts a value at the given index to a C function. That value must be a\nC function; otherwise, returns `NULL`.\n
lua_tointeger lua_tointeger(lua_State *L, int index) [lua_Integer]\nEquivalent to `lua_tointegerx` with `isnum` equal to `NULL`.\n
lua_tointegerx lua_tointegerx(lua_State *L, int index, int *isnum) [lua_Integer]\nConverts the Lua value at the given index to the signed integral type\n`lua_Integer`. The Lua value must be an integer, or a number or a string\nconvertible to an integer (see §3.4.3); otherwise, `lua_tointegerx` returns 0.\n\nIf `isnum` is not `NULL`, its referent is assigned a boolean value that\nindicates whether the operation succeeded.\n
-lua_tolstring lua_tolstring(lua_State *L, int index, size_t *len) [const char*]\nConverts the Lua value at the given index to a C string. If `len` is not\n`NULL`, it sets `*len` with the string length. The Lua value must be a string\nor a number; otherwise, the function returns `NULL`. If the value is a number,\nthen `lua_tolstring` also _changes the actual value in the stack to a string_.\n(This change confuses `lua_next` when `lua_tolstring` is applied to keys during\na table traversal.)\n\n`lua_tolstring` returns a pointer to a string inside the Lua state. This string\nalways has a zero ('\0') after its last character (as in C), but can contain\nother zeros in its body.\n\nBecause Lua has garbage collection, there is no guarantee that the pointer\nreturned by `lua_tolstring` will be valid after the corresponding Lua value\nis removed from the stack.\n
+lua_tolstring lua_tolstring(lua_State *L, int index, size_t *len) [const char*]\nConverts the Lua value at the given index to a C string. If `len` is not\n`NULL`, it sets `*len` with the string length. The Lua value must be a string\nor a number; otherwise, the function returns `NULL`. If the value is a number,\nthen `lua_tolstring` also _changes the actual value in the stack to a string_.\n(This change confuses `lua_next` when `lua_tolstring` is applied to keys during\na table traversal.)\n\n`lua_tolstring` returns a pointer to a string inside the Lua state (see §4.1.3). \nThis string always has a zero ('\0') after its last character (as in C), but can \ncontain other zeros in its body.\n
lua_tonumber lua_tonumber(lua_State *L, int index) [lua_Number]\nEquivalent to `lua_tonumberx` with `isnum` equal to `NULL`.\n
lua_tonumberx lua_tonumberx(lua_State *L, int index, int *isnum) [lua_Number]\nConverts the Lua value at the given index to the C type `lua_Number` (see\n`lua_Number`). The Lua value must be a number or a string convertible to a\nnumber (see §3.4.3); otherwise, `lua_tonumberx` returns 0.\n\nIf `isnum` is not `NULL`, its referent is assigned a boolean value that\nindicates whether the operation succeeded.\n
-lua_topointer lua_topointer(lua_State *L, int index) [const void*]\nConverts the value at the given index to a generic C pointer (`void*`).\nThe value can be a userdata, a table, a thread, or a function; otherwise,\n`lua_topointer` returns `NULL`. Different objects will give different\npointers. There is no way to convert the pointer back to its original value.\n\nTypically this function is used only for debug information.\n
+lua_topointer lua_topointer(lua_State *L, int index) [const void*]\nConverts the value at the given index to a generic C pointer (`void*`).\nThe value can be a userdata, a table, a thread, a string, or a function; \notherwise, `lua_topointer` returns `NULL`. Different objects will give \ndifferent pointers. There is no way to convert the pointer back to its original \nvalue.\n\nTypically this function is used only for debug information.\n
lua_tostring lua_tostring(lua_State *L, int index) [const char*]\nEquivalent to `lua_tolstring` with `len` equal to `NULL`.\n
lua_tothread lua_tothread(lua_State *L, int index) [lua_State*]\nConverts the value at the given index to a Lua thread (represented as\n`lua_State*`). This value must be a thread; otherwise, the function\nreturns `NULL`.\n
-lua_touserdata lua_touserdata(lua_State *L, int index) [void*]\nIf the value at the given index is a full userdata, returns its block address.\nIf the value is a light userdata, returns its pointer. Otherwise, returns\n`NULL`.\n
-lua_type lua_type(lua_State *L, int index) [int]\nReturns the type of the value in the given index, or `LUA_TNONE` for a non-valid\n(but acceptable) index.\n\nThe types returned by `lua_type` are coded by the following constants defined in\n`lua.h`: `LUA_TNIL`, `LUA_TNUMBER`, `LUA_TBOOLEAN`, `LUA_TSTRING`, `LUA_TTABLE`,\n`LUA_TFUNCTION`, `LUA_TUSERDATA`, `LUA_TTHREAD`, and `LUA_TLIGHTUSERDATA`.\n
+lua_touserdata lua_touserdata(lua_State *L, int index) [void*]\nIf the value at the given index is a full userdata, returns its memory-block \naddress. If the value is a light userdata, returns its value (a pointer). \nOtherwise, returns `NULL`.\n
+lua_type lua_type(lua_State *L, int index) [int]\nReturns the type of the value in the given index, or `LUA_TNONE` for a non-valid\nbut acceptable index.\n\nThe types returned by `lua_type` are coded by the following constants defined in\n`lua.h`: `LUA_TNIL`, `LUA_TNUMBER`, `LUA_TBOOLEAN`, `LUA_TSTRING`, `LUA_TTABLE`,\n`LUA_TFUNCTION`, `LUA_TUSERDATA`, `LUA_TTHREAD`, and `LUA_TLIGHTUSERDATA`.\n
lua_typename lua_typename(lua_State *L, int tp) [const char*]\nReturns the name of the type encoded by the value `tp`, which must be one\nthe values returned by `lua_type`.\n
lua_Unsigned lua_Unsigned [typedef ... lua_Unsigned]\nThe unsigned version of `lua_Integer`.\n
-lua_upvalueindex lua_upvalueindex(lua_State *L, int i) [int]\nReturns the pseudo-index that represents the `i`-th upvalue of the running\nfunction (see §4.4).\n
-lua_version lua_version(lua_State *L) [const lua_Number]\nReturns the address of the version number (a C static variable) stored in the\nLua core. When called with a valid `lua_State`, returns the address of the\nversion used to create that state. When called with `NULL`, returns the address\nof the version running the call.\n
-lua_Writer (*lua_Writer)(lua_State *L, const void* p, size_t sz, void* ud) [int]\nThe type of the writer function used by `lua_dump`. Every time it produces\nanother piece of chunk, `lua_dump` calls the writer, passing along the buffer\nto be written (`p`), its size (`sz`), and the `data` parameter supplied to\n`lua_dump`.\n\nThe writer returns an error code: 0 means no errors; any other value means\nan error and stops `lua_dump` from calling the writer again.\n
+lua_upvalueindex lua_upvalueindex(lua_State *L, int i) [int]\nReturns the pseudo-index that represents the `i`-th upvalue of the running\nfunction (see §4.2). `i` must be in the range *[1,256]*.\n
+lua_version lua_version(lua_State *L) [lua_Number]\nReturns the version number of this core.\n
+lua_WarnFunction lua_WarnFunction [void (*)(void *ud, const char *msg, int tocont)]\nThe type of warning functions, called by Lua to emit warnings. The first \nparameter is an opaque pointer set by `lua_setwarnf`. The second parameter is \nthe warning message. The third parameter is a boolean that indicates whether \nthe message is to be continued by the message in the next call.\n\nSee `warn` for more details about warnings.\n
+lua_warning lua_warning(lua_State *L, const char *msg, int tocont) [void]\nEmits a warning with the given message. A message in a call with `tocont` true \nshould be continued in another call to this function.\n\nSee `warn` for more details about warnings.\n
+lua_Writer (*lua_Writer)(lua_State *L, const void* p, size_t sz, void* ud) [int]\nThe type of the writer function used by `lua_dump`. Every time `lua_dump`\nproduces another piece of chunk, it calls the writer, passing along the buffer\nto be written (`p`), its size (`sz`), and the `ud` parameter supplied to\n`lua_dump`.\n\nThe writer returns an error code: 0 means no errors; any other value means\nan error and stops `lua_dump` from calling the writer again.\n
lua_xmove lua_xmove(lua_State *from, lua_State *to, int n) [void]\nExchange values between different threads of the same state.\n\nThis function pops `n` values from the stack `from`, and pushes them onto\nthe stack `to`.\n
-lua_yield lua_yield(lua_State *L, int nresults) [int]\nThis function is equivalent to `lua_yieldk`, but it has no continuation\n(see §4.7). Therefore, when the thread resumes, it continues the function that\ncalled the function calling `lua_yield`.\n
-lua_yieldk lua_yieldk(lua_State *L, int nresults, lua_KContext ctx, lua_KFunction k) [int]\nYields a coroutine (thread).\n\nWhen a C function calls `lua_yieldk`, the running coroutine suspends its\nexecution, and the call to `lua_resume` that started this coroutine returns.\nThe parameter `nresults` is the number of values from the stack that will be\npassed as results to `lua_resume`.\n\nWhen the coroutine is resumed again, Lua calls the given continuation function\n`k` to continue the execution of the C function that yielded (see §4.7). This\ncontinuation function receives the same stack from the previous function, with\nthe `n` results removed and replaced by the arguments passed to `lua_resume`.\nMoreover, the continuation function receives the value `ctx` that was passed to\n`lua_yield`.\n\nUsually, this function does not return; when the coroutine eventually resumes,\nit continues executing the continuation function. However, there is one special\ncase, which is when this function is called from inside a line or a count hook\n(see §4.9). In that case, `lua_yieldk` should be called with no continuation\n(probably in the form of `lua_yield` and no results), and the hook should return\nimmediately after the call. Lua will yield and, when the coroutine resumes\nagain, it will continue the normal execution of the (Lua) function that\ntriggered the hook.\n\nThis function can raise an error if it is called from a thread with a pending C\ncall with no continuation function, or it is called from a thread that is not\nrunning inside a resume (e.g., the main thread).\n
-lua_Debug lua_Debug [struct]\ntypedef struct lua_Debug {\n int event;\n const char *name; /* (n) */\n const char *namewhat; /* (n) */\n const char *what; /* (S) */\n const char *source; /* (S) */\n int currentline; /* (l) */\n int linedefined; /* (S) */\n int lastlinedefined; /* (S) */\n unsigned char nups; /* (u) number of upvalues */\n unsigned char nparams; /* (u) number of parameters */\n char isvararg; /* (u) */\n char istailcall; /* (t) */\n char short_src[LUA_IDSIZE]; /* (S) */\n /* private part */\n _other fields_\n} lua_Debug;\n\nA structure used to carry different pieces of information about a function or an\nactivation record. `lua_getstack` fills only the private part of this\nstructure, for later use. To fill the other fields of `lua_Debug` with useful\ninformation, call `lua_getinfo`.\n\nThe fields of `lua_Debug` have the following meaning:\n * source: the name of the chunk that created the function. If `source`\n starts with a '`@`', it means that the function was defined in a file where\n the file name follows the '`@`'. If `source` starts with a '`=`', the\n remainder of its contents describe the source in a user-dependent manner.\n Otherwise, the function was defined in a string where `source` is that\n string.\n * short_src: a "printable" version of `source`, to be used in error messages.\n * linedefined: the line number where the definition of the function starts.\n * lastlinedefined: the line number where the definition of the function ends.\n * what: the string "Lua" if the function is a Lua function, "C" if it is a\n C function, "main" if it is the main part of a chunk.\n * currentline: the current line where the given function is executing.\n When no line information is available, `currentline` is set to -1.\n * name: a reasonable name for the given function. Because functions in Lua\n are first-class values, they do not have a fixed name: some functions\n can be the value of multiple global variables, while others can be\n stored only in a table field. The `lua_getinfo` function checks how the\n function was called to find a suitable name. If it cannot find a name,\n then `name` is set to `NULL`.\n * namewhat: explains the `name` field. The value of `namewhat` can be\n "global", "local", "method", "field", "upvalue", or "" (the empty string),\n according to how the function was called. (Lua uses the empty string\n when no other option seems to apply.)\n * istailcall: true if this function invocation was called by a tail call. In\n this case, the caller of this level is not in the stack.\n * nups: the number of upvalues of the function.\n * nparams: the number of fixed parameters of the function (always 0 for C\n functions).\n * isvararg: true if the function is a vararg function (always true for C\n functions).\n
+lua_yield lua_yield(lua_State *L, int nresults) [int]\nThis function is equivalent to `lua_yieldk`, but it has no continuation\n(see §4.5). Therefore, when the thread resumes, it continues the function that\ncalled the function calling `lua_yield`. To avoid surprises, this function \nshould be called only in a tail call.\n
+lua_yieldk lua_yieldk(lua_State *L, int nresults, lua_KContext ctx, lua_KFunction k) [int]\nYields a coroutine (thread).\n\nWhen a C function calls `lua_yieldk`, the running coroutine suspends its\nexecution, and the call to `lua_resume` that started this coroutine returns.\nThe parameter `nresults` is the number of values from the stack that will be\npassed as results to `lua_resume`.\n\nWhen the coroutine is resumed again, Lua calls the given continuation function\n`k` to continue the execution of the C function that yielded (see §4.5). This\ncontinuation function receives the same stack from the previous function, with\nthe `n` results removed and replaced by the arguments passed to `lua_resume`.\nMoreover, the continuation function receives the value `ctx` that was passed to\n`lua_yield`.\n\nUsually, this function does not return; when the coroutine eventually resumes,\nit continues executing the continuation function. However, there is one special\ncase, which is when this function is called from inside a line or a count hook\n(see §4.7). In that case, `lua_yieldk` should be called with no continuation\n(probably in the form of `lua_yield` and no results), and the hook should return\nimmediately after the call. Lua will yield and, when the coroutine resumes\nagain, it will continue the normal execution of the (Lua) function that\ntriggered the hook.\n\nThis function can raise an error if it is called from a thread with a pending C\ncall with no continuation function (what is called a *C-call boundary*), or it \nis called from a thread that is not running inside a resume (typically the main \nthread).\n
+lua_Debug lua_Debug [struct]\ntypedef struct lua_Debug {\n int event;\n const char *name; /* (n) */\n const char *namewhat; /* (n) */\n const char *what; /* (S) */\n const char *source; /* (S) */\n size_t srclen; /* (S) */\n int currentline; /* (l) */\n int linedefined; /* (S) */\n int lastlinedefined; /* (S) */\n unsigned char nups; /* (u) number of upvalues */\n unsigned char nparams; /* (u) number of parameters */\n char isvararg; /* (u) */\n char istailcall; /* (t) */\n unsigned short ftransfer; /* (r) index of first value transferred */\n unsigned short ntransfer; /* (r) number of transferred values */\n char short_src[LUA_IDSIZE]; /* (S) */\n /* private part */\n _other fields_\n} lua_Debug;\n\nA structure used to carry different pieces of information about a function or an\nactivation record. `lua_getstack` fills only the private part of this\nstructure, for later use. To fill the other fields of `lua_Debug` with useful\ninformation, you must call `lua_getinfo`.\n\nThe fields of `lua_Debug` have the following meaning:\n * source: the source of the chunk that created the function. If `source`\n starts with a '`@`', it means that the function was defined in a file where\n the file name follows the '`@`'. If `source` starts with a '`=`', the\n remainder of its contents describes the source in a user-dependent manner.\n Otherwise, the function was defined in a string where `source` is that\n string.\n * srclen: The length of the string `source`.\n * short_src: a "printable" version of `source`, to be used in error messages.\n * linedefined: the line number where the definition of the function starts.\n * lastlinedefined: the line number where the definition of the function ends.\n * what: the string "Lua" if the function is a Lua function, "C" if it is a\n C function, "main" if it is the main part of a chunk.\n * currentline: the current line where the given function is executing.\n When no line information is available, `currentline` is set to -1.\n * name: a reasonable name for the given function. Because functions in Lua\n are first-class values, they do not have a fixed name: some functions\n can be the value of multiple global variables, while others can be\n stored only in a table field. The `lua_getinfo` function checks how the\n function was called to find a suitable name. If it cannot find a name,\n then `name` is set to `NULL`.\n * namewhat: explains the `name` field. The value of `namewhat` can be\n "global", "local", "method", "field", "upvalue", or "" (the empty string),\n according to how the function was called. (Lua uses the empty string\n when no other option seems to apply.)\n * istailcall: true if this function invocation was called by a tail call. In\n this case, the caller of this level is not in the stack.\n * nups: the number of upvalues of the function.\n * nparams: the number of parameters of the function (always 0 for C\n functions).\n * isvararg: true if the function is a vararg function (always true for C\n functions).\n * ftransfer: the index in the stack of the first value being "transferred",\n that is, parameters in a call or return values in a return. (The other \n values are in consecutive indices.) Using this index, you can access and \n modify these values through `lua_getlocal` and `lua_setlocal`. This field \n is only meaningful during a call hook, denoting the first parameter, or a \n return hook, denoting the first value being returned. (For call hooks, this \n value is always 1.)\n * ntransfer: The number of values being transferred (see previous item).\n (For calls of Lua functions, this value is always equal to `nparams`.)\n
lua_gethook lua_gethook(lua_State *L) [lua_Hook]\nReturns the current hook function.\n
lua_gethookcount lua_gethookcount(lua_State *L) [int]\nReturns the current hook count.\n
lua_gethookmask lua_gethookmask(lua_State *L) [int]\nReturns the current hook mask.\n
-lua_getinfo lua_getinfo(lua_State *L, const char *what, lua_Debug *ar) [int]\nGets information about a specific function or function invocation.\n\nTo get information about a function invocation, the parameter `ar` must be a\nvalid activation record that was filled by a previous call to `lua_getstack`\nor given as argument to a hook (see `lua_Hook`).\n\nTo get information about a function you push it onto the stack and start the\n`what` string with the character '>'. (In that case, `lua_getinfo` pops the\nfunction from the top of the stack.) For instance, to know in which line a\nfunction `f` was defined, you can write the following code:\n\n lua_Debug ar;\n lua_getglobal(L, "f"); /* get global 'f' */\n lua_getinfo(L, ">S", &ar);\n printf("%d\\n", ar.linedefined);\n\nEach character in the string `what` selects some fields of the structure\n`ar` to be filled or a value to be pushed on the stack:\n * 'n': fills in the field `name` and `namewhat`;\n * 'S': fills in the fields `source`, `short_src`, `linedefined`,\n `lastlinedefined`, and `what`;\n * 'l': fills in the field `currentline`;\n * 't': fills in the field `istailcall`;\n * 'u': fills in the fields `nups`, `nparams`, and `isvararg`;\n * 'f': pushes onto the stack the function that is running at the given level;\n * 'L': pushes onto the stack a table whose indices are the numbers of the\n lines that are valid on the function. (A _valid line_ is a line with\n some associated code, that is, a line where you can put a break point.\n Non-valid lines include empty lines and comments.)\n \n If this option is given together with option 'f', its table is pushed after\n the function. \n\nThis function returns 0 on error (for instance, an invalid option in `what`).\n
-lua_getlocal lua_getlocal(lua_State *L, const lua_Debug *ar, int n) [const char*]\nGets information about a local variable of a given activation record or a given\nfunction.\n\nIn the first case, the parameter `ar` must be a valid activation record that was\nfilled by a previous call to `lua_getstack` or given as argument to a hook (see\n`lua_Hook`). The index `n` selects which local variable to inspect; see\n`debug.getlocal` for details about variable indices and names.\n\n`lua_getlocal` pushes the variable's value onto the stack and returns its name.\n\nIn the second case, `ar` must be `NULL` and the function to be inspected must\nbe at the top of the stack. In this case, only parameters of Lua functions are\nvisible (as there is no information about what variables are active) and no\nvalues are pushed onto the stack.\n\nReturns `NULL` (and pushes nothing) when the index is greater than the number of\nactive local variables.\n
-lua_getstack lua_getstack(lua_State *L, int level, lua_Debug *ar) [int]\nGets information about the interpreter runtime stack.\n\nThis function fills parts of a `lua_Debug` structure with an identification of\nthe _activation record_ of the function executing at a given level. Level 0\nis the current running function, whereas level _n+1_ is the function that\nhas called level _n_ (except for tail calls, which do not count on the stack).\nWhen there are no errors, `lua_getstack` returns 1; when called with a level\ngreater than the stack depth, it returns 0.\n
-lua_getupvalue lua_getupvalue(lua_State *L, int funcindex, int n) [const char*]\nGets information about a closure's upvalue. (For Lua functions, upvalues are\nthe external local variables that the function uses, and that are consequently\nincluded in its closure.) `lua_getupvalue` gets the index `n` of an upvalue,\npushes the upvalue's value onto the stack, and returns its name.`funcindex`\npoints to the closure in the stack. (Upvalues have no particular order,\nas they are active through the whole function. So, they are numbered in an\narbitrary order.)\n\nReturns `NULL` (and pushes nothing) when the index is greater than the\nnumber of upvalues. For C functions, this function uses the empty string\n"" as a name for all upvalues.\n
+lua_getinfo lua_getinfo(lua_State *L, const char *what, lua_Debug *ar) [int]\nGets information about a specific function or function invocation.\n\nTo get information about a function invocation, the parameter `ar` must be a\nvalid activation record that was filled by a previous call to `lua_getstack`\nor given as argument to a hook (see `lua_Hook`).\n\nTo get information about a function you push it onto the stack and start the\n`what` string with the character '>'. (In that case, `lua_getinfo` pops the\nfunction from the top of the stack.) For instance, to know in which line a\nfunction `f` was defined, you can write the following code:\n\n lua_Debug ar;\n lua_getglobal(L, "f"); /* get global 'f' */\n lua_getinfo(L, ">S", &ar);\n printf("%d\\n", ar.linedefined);\n\nEach character in the string `what` selects some fields of the structure\n`ar` to be filled or a value to be pushed on the stack:\n * 'n': fills in the field `name` and `namewhat`;\n * 'S': fills in the fields `source`, `short_src`, `linedefined`,\n `lastlinedefined`, and `what`;\n * 'l': fills in the field `currentline`;\n * 't': fills in the field `istailcall`;\n * 'u': fills in the fields `nups`, `nparams`, and `isvararg`;\n * 'f': pushes onto the stack the function that is running at the given level;\n * 'L': pushes onto the stack a table whose indices are the numbers of the\n lines that are valid on the function. (A _valid line_ is a line with\n some associated code, that is, a line where you can put a break point.\n Non-valid lines include empty lines and comments.)\n \n If this option is given together with option 'f', its table is pushed after\n the function.\n \n This is the only option that can raise a memory error.\n\nThis function returns 0 to signal an invalid option in `what`; even then the\nvalid options are handled correctly.\n
+lua_getlocal lua_getlocal(lua_State *L, const lua_Debug *ar, int n) [const char*]\nGets information about a local variable or a temporary value of a given \nactivation record or a given function.\n\nIn the first case, the parameter `ar` must be a valid activation record that was\nfilled by a previous call to `lua_getstack` or given as argument to a hook (see\n`lua_Hook`). The index `n` selects which local variable to inspect; see\n`debug.getlocal` for details about variable indices and names.\n\n`lua_getlocal` pushes the variable's value onto the stack and returns its name.\n\nIn the second case, `ar` must be `NULL` and the function to be inspected must\nbe on the top of the stack. In this case, only parameters of Lua functions are\nvisible (as there is no information about what variables are active) and no\nvalues are pushed onto the stack.\n\nReturns `NULL` (and pushes nothing) when the index is greater than the number of\nactive local variables.\n
+lua_getstack lua_getstack(lua_State *L, int level, lua_Debug *ar) [int]\nGets information about the interpreter runtime stack.\n\nThis function fills parts of a `lua_Debug` structure with an identification of\nthe _activation record_ of the function executing at a given level. Level 0\nis the current running function, whereas level _n+1_ is the function that\nhas called level _n_ (except for tail calls, which do not count in the stack).\nWhen called with a level greater than the stack depth, `lua_getstack` returns 0; \notherwise it returns 1.\n
+lua_getupvalue lua_getupvalue(lua_State *L, int funcindex, int n) [const char*]\nGets information about the `n`-th upvalue of the closure at index `funcindex`.\nIt pushes the upvalue's value onto the stack and returns its name. Returns \n`NULL` (and pushes nothing) when the index `n` is greater than the number of \nupvalues.\n\nSee `debug.getupvalue` for more information about upvalues.\n
lua_Hook (*lua_Hook)(lua_State *L, lua_Debug *ar) [void]\nType for debugging hook functions.\n\nWhenever a hook is called, its `ar` argument has its field `event` set to the\nspecific event that triggered the hook. Lua identifies these events with\nthe following constants: `LUA_HOOKCALL`, `LUA_HOOKRET`, `LUA_HOOKTAILCALL`,\n`LUA_HOOKLINE`, and `LUA_HOOKCOUNT`. Moreover, for line events, the\nfield `currentline` is also set. To get the value of any other field in\n`ar`, the hook must call `lua_getinfo`.\n\nFor call events, `event` can be `LUA_HOOKCALL`, the normal value, or\n`LUA_HOOKTAILCALL`, for a tail call; in this case, there will be no\ncorresponding return event.\n\nWhile Lua is running a hook, it disables other calls to hooks. Therefore,\nif a hook calls back Lua to execute a function or a chunk, this execution\noccurs without any calls to hooks.\n\nHook functions cannot have continuations, that is, they cannot call\n`lua_yieldk`, `lua_pcallk`, or `lua_callk` with a non-null `k`.\n\nHook functions can yield under the following conditions: Only count and line\nevents can yield and they cannot yield any value; to yield a hook function must\nfinish its execution calling `lua_yield` with `nresults` equal to zero.\n
-lua_sethook lua_sethook(lua_State *L, lua_Hook f, int mask, int count) [void]\nSets the debugging hook function.\n\nArgument `f` is the hook function.\n\n`mask` specifies on which events the hook will be called: it is formed by a\nbitwise OR of the constants `LUA_MASKCALL`, `LUA_MASKRET`, `LUA_MASKLINE`,\nand `LUA_MASKCOUNT`. The `count` argument is only meaningful when the mask\nincludes `LUA_MASKCOUNT`. For each event, the hook is called as explained\nbelow:\n * The call hook: is called when the interpreter calls a function. The hook is\n called just after Lua enters the new function, before the function gets\n its arguments.\n * The return hook: is called when the interpreter returns from a function.\n The hook is called just before Lua leaves the function. There is no\n standard way to access the values to be returned by the function.\n * The line hook: is called when the interpreter is about to start the\n execution of a new line of code, or when it jumps back in the code (even\n to the same line). (This event only happens while Lua is executing a\n Lua function.)\n * The count hook: is called after the interpreter executes every `count`\n instructions. (This event only happens while Lua is executing a Lua\n function.)\n\nA hook is disabled by setting `mask` to zero.\n
-lua_setlocal lua_setlocal(lua_State *L, const lua_Debug *ar, int n) [const char*]\nSets the value of a local variable of a given activation record. Parameters\n`ar` and `n` are as in `lua_getlocal` (see `lua_getlocal`). `lua_setlocal`\nassigns the value at the top of the stack to the variable and returns its name.\nIt also pops the value from the stack.\n\nReturns `NULL` (and pops nothing) when the index is greater than the number\nof active local variables.\n
-lua_setupvalue lua_setupvalue(lua_State *L, int funcindex, int n) [const char*]\nSets the value of a closure's upvalue. It assigns the value at the top of\nthe stack to the upvalue and returns its name. It also pops the value from\nthe stack. Parameters `funcindex` and `n` are as in the `lua_getupvalue`\n(see `lua_getupvalue`).\n\nReturns `NULL` (and pops nothing) when the index is greater than the number\nof upvalues.\n
-lua_upvalueid lua_upvalueid(lua_State *L, int funcindex, int n) [void*]\nReturns a unique identifier for the upvalue numbered `n` from the closure at\nindex `funcindex`. Parameters `funcindex` and `n` are as in the\n`lua_getupvalue` (see `lua_getupvalue`) (but `n` cannot be greater than the\nnumber of upvalues).\n\nThese unique identifiers allow a program to check whether different closures\nshare upvalues. Lua closures that share an upvalue (that is, that access a same\nexternal local variable) will return identical ids for those upvalue indices.\n
+lua_sethook lua_sethook(lua_State *L, lua_Hook f, int mask, int count) [void]\nSets the debugging hook function.\n\nArgument `f` is the hook function.\n\n`mask` specifies on which events the hook will be called: it is formed by a\nbitwise OR of the constants `LUA_MASKCALL`, `LUA_MASKRET`, `LUA_MASKLINE`,\nand `LUA_MASKCOUNT`. The `count` argument is only meaningful when the mask\nincludes `LUA_MASKCOUNT`. For each event, the hook is called as explained\nbelow:\n * The call hook: is called when the interpreter calls a function. The hook is\n called just after Lua enters the new function.\n * The return hook: is called when the interpreter returns from a function.\n The hook is called just before Lua leaves the function.\n * The line hook: is called when the interpreter is about to start the\n execution of a new line of code, or when it jumps back in the code (even\n to the same line). This event only happens while Lua is executing a\n Lua function.\n * The count hook: is called after the interpreter executes every `count`\n instructions. This event only happens while Lua is executing a Lua\n function.\n\nHooks are disabled by setting `mask` to zero.\n
+lua_setlocal lua_setlocal(lua_State *L, const lua_Debug *ar, int n) [const char*]\nSets the value of a local variable of a given activation record. Parameters\n`ar` and `n` are as in `lua_getlocal` (see `lua_getlocal`). `lua_setlocal`\nassigns the value on the top of the stack to the variable and returns its name.\nIt also pops the value from the stack.\n\nReturns `NULL` (and pops nothing) when the index is greater than the number\nof active local variables.\n\nParameters `ar` and `n` are as in the function `lua_getlocal`.\n
+lua_setupvalue lua_setupvalue(lua_State *L, int funcindex, int n) [const char*]\nSets the value of a closure's upvalue. It assigns the value on the top of\nthe stack to the upvalue and returns its name. It also pops the value from\nthe stack. Parameters `funcindex` and `n` are as in the `lua_getupvalue`\n(see `lua_getupvalue`).\n\nReturns `NULL` (and pops nothing) when the index is greater than the number\nof upvalues.\n\nParameters `funcindex` and `n` are as in the function `lua_getupvalue`.\n
+lua_upvalueid lua_upvalueid(lua_State *L, int funcindex, int n) [void*]\nReturns a unique identifier for the upvalue numbered `n` from the closure at\nindex `funcindex`. Parameters `funcindex` and `n` are as in the\n`lua_getupvalue` (see `lua_getupvalue`) (but `n` cannot be greater than the\nnumber of upvalues).\n\nThese unique identifiers allow a program to check whether different closures\nshare upvalues. Lua closures that share an upvalue (that is, that access a same\nexternal local variable) will return identical ids for those upvalue indices.\n\nParameters `funcindex` and `n` are as in the function `lua_getupvalue`, but `n` \ncannot be greater than the number of upvalues.\n
lua_upvaluejoin lua_upvaluejoin(lua_State *L, int funcindex1, int n1, int funcindex2, int n2) [void]\nMake the `n1`-th upvalue of the Lua closure at index `funcindex1` refer to the\n`n2`-th upvalue of the Lua closure at index `funcindex2`.\n
luaL_addchar luaL_addchar(luaL_Buffer *B, char c) [void]\nAdds the byte `c` to the buffer `B` (see `luaL_Buffer`).\n
+luaL_addgsub luaL_addgsub(luaL_Buffer *B, const char *s, const char *p, const char *r) [const void]\nAdds a copy of the string `s` to the buffer `B` (see `luaL_Buffer`), replacing \nany occurrence of the string `p` with the string `r`.\n
luaL_addlstring luaL_addlstring(luaL_Buffer *B, const char *s, size_t l) [void]\nAdds the string pointed to by `s` with length `l` to the buffer `B` (see\n`luaL_Buffer`). The string can contain embedded zeros.\n
-luaL_addsize luaL_addsize(luaL_Buffer *B, size_t n) [void]\nAdds to the buffer `B` (see `luaL_Buffer`) a string of length `n` previously\ncopied to the buffer area (see `luaL_prepbuffer`).\n
+luaL_addsize luaL_addsize(luaL_Buffer *B, size_t n) [void]\nAdds to the buffer `B` a string of length `n` previously copied to the buffer \narea (see `luaL_prepbuffer`).\n
luaL_addstring luaL_addstring(luaL_Buffer *B, const char *s) [void]\nAdds the zero-terminated string pointed to by `s` to the buffer `B` (see\n`luaL_Buffer`).\n
-luaL_addvalue luaL_addvalue(luaL_Buffer *B) [void]\nAdds the value at the top of the stack to the buffer `B` (see `luaL_Buffer`).\nPops the value.\n\nThis is the only function on string buffers that can (and must) be called with\nan extra element on the stack, which is the value to be added to the buffer.\n
+luaL_addvalue luaL_addvalue(luaL_Buffer *B) [void]\nAdds the value on the top of the stack to the buffer `B` (see `luaL_Buffer`).\nPops the value.\n\nThis is the only function on string buffers that can (and must) be called with\nan extra element on the stack, which is the value to be added to the buffer.\n
luaL_argcheck luaL_argcheck(lua_State *L, int cond, int arg, const char *extramsg) [void]\nChecks whether `cond` is true. If it is not, raises an error with a standard\nmessage (see `luaL_argerror`).\n
luaL_argerror luaL_argerror(lua_State *L, int arg, const char *extramsg) [int]\nRaises an error reporting a problem with argument `arg` of the C function that\ncalled it, using a standard message that includes `extramsg` as a comment:\n\n bad argument #_arg_ to '_funcname_' (_extramsg_)\n\nThis function never returns.\n
-luaL_Buffer luaL_Buffer [struct]\nType for a _string buffer_.\n\nA string buffer allows C code to build Lua strings piecemeal. Its pattern\nof use is as follows:\n * First declare a variable `b` of type `luaL_Buffer`.\n * Then initialize it with a call `luaL_buffinit(L, &b)`.\n * Then add string pieces to the buffer calling any of the `luaL_add*`\n functions.\n * Finish by calling `luaL_pushresult(&b)`. This call leaves the final string\n on the top of the stack.\n\nIf you know beforehand the total size of the resulting string, you can use the\nbuffer like this:\n * First declare a variable `b` of type `luaL_Buffer`.\n * Then initialize it and preallocate a space of size `sz` with a call\n `luaL_buffinitsize(L, &b, sz)`.\n * Then copy the string into that space.\n * Finish by calling `luaL_pushresultsize(&b, sz)`, where `sz` is the total\n size of the resulting string copied into that space.\n\nDuring its normal operation, a string buffer uses a variable number of\nstack slots. So, while using a buffer, you cannot assume that you know\nwhere the top of the stack is. You can use the stack between successive\ncalls to buffer operations as long as that use is balanced; that is, when you\ncall a buffer operation, the stack is at the same level it was immediately\nafter the previous buffer operation. (The only exception to this rule is\n`luaL_addvalue`.) After calling `luaL_pushresult` the stack is back to its\nlevel when the buffer was initialized, plus the final string on its top.\n
-luaL_buffinit luaL_buffinit(lua_State *L, luaL_Buffer *B) [void]\nInitializes a buffer `B`. This function does not allocate any space; the\nbuffer must be declared as a variable (see `luaL_Buffer`).\n
+luaL_argexpected luaL_argexpected(lua_State *L, int cond, int arg, const char *tname) [void]\nChecks whether `cond` is true. If it is not, raises an error about the type of \nthe argument `arg` with a standard message (see `luaL_typeerror`).\n
+luaL_Buffer luaL_Buffer [struct]\nType for a _string buffer_.\n\nA string buffer allows C code to build Lua strings piecemeal. Its pattern\nof use is as follows:\n * First declare a variable `b` of type `luaL_Buffer`.\n * Then initialize it with a call `luaL_buffinit(L, &b)`.\n * Then add string pieces to the buffer calling any of the `luaL_add*`\n functions.\n * Finish by calling `luaL_pushresult(&b)`. This call leaves the final string\n on the top of the stack.\n\nIf you know beforehand the maximum size of the resulting string, you can use the\nbuffer like this:\n * First declare a variable `b` of type `luaL_Buffer`.\n * Then initialize it and preallocate a space of size `sz` with a call\n `luaL_buffinitsize(L, &b, sz)`.\n * Then produce the string into that space.\n * Finish by calling `luaL_pushresultsize(&b, sz)`, where `sz` is the total\n size of the resulting string copied into that space (which may be less than\n or equal to the preallocated size).\n\nDuring its normal operation, a string buffer uses a variable number of\nstack slots. So, while using a buffer, you cannot assume that you know\nwhere the top of the stack is. You can use the stack between successive\ncalls to buffer operations as long as that use is balanced; that is, when you\ncall a buffer operation, the stack is at the same level it was immediately\nafter the previous buffer operation. (The only exception to this rule is\n`luaL_addvalue`.) After calling `luaL_pushresult`, the stack is back to its\nlevel when the buffer was initialized, plus the final string on its top.\n
+luaL_buffaddr luaL_buffaddr(luaL_Buffer *B) [char*]\nReturns the address of the current content of buffer `B` (see `luaL_Buffer`).\nNote that any addition to the buffer may invalidate this address.\n
+luaL_buffinit luaL_buffinit(lua_State *L, luaL_Buffer *B) [void]\nInitializes a buffer `B` (see `luaL_Buffer`). This function does not allocate \nany space; the buffer must be declared as a variable.\n
+luaL_bufflen luaL_bufflen(luaL_Buffer *B) [size_t]\nReturns the length of the current content of buffer `B` (see `luaL_Buffer`).\n
luaL_buffinitsize luaL_buffinitsize(lua_State *L, luaL_Buffer *B, size_t sz) [char*]\nEquivalent to the sequence `luaL_buffinit`, `luaL_prepbuffsize`.\n
-luaL_callmeta luaL_callmeta(lua_State *L, int obj, const char *e) [int]\nCalls a metamethod.\n\nIf the object at index `obj` has a metatable and this metatable has a field\n`e`, this function calls this field passing the object as its only argument.\nIn this case this function returns true and pushes onto the stack the value\nreturned by the call. If there is no metatable or no metamethod, this function\nreturns false (without pushing any value on the stack).\n
+luaL_buffsub luaL_buffsub(luaL_Buffer *B, int n) [void]\nRemoves `n` bytes from the the buffer `B` (see `luaL_Buffer`). The buffer must \nhave at least that many bytes.\n
+luaL_callmeta luaL_callmeta(lua_State *L, int obj, const char *e) [int]\nCalls a metamethod.\n\nIf the object at index `obj` has a metatable and this metatable has a field\n`e`, this function calls this field passing the object as its only argument.\nIn this case this function returns true and pushes onto the stack the value\nreturned by the call. If there is no metatable or no metamethod, this function\nreturns false without pushing any value on the stack.\n
luaL_checkany luaL_checkany(lua_State *L, int arg) [void]\nChecks whether the function has an argument of any type (including nil)\nat position `arg`.\n
-luaL_checkinteger luaL_checkinteger(lua_State *L, int arg) [lua_Integer]\nChecks whether the function argument `arg` is an integer (or can be converted to\nan integer) and returns this integer cast to a `lua_Integer`.\n
-luaL_checklstring luaL_checklstring(lua_State *L, int arg, size_t *l) [const char*]\nChecks whether the function argument `arg` is a string and returns this string;\nif `l` is not `NULL` fills `*l` with the string's length.\n\nThis function uses `lua_tolstring` to get its result, so all conversions\nand caveats of that function apply here.\n
-luaL_checknumber luaL_checknumber(lua_State *L, int arg) [lua_Number]\nChecks whether the function argument `arg` is a number and returns this number.\n
+luaL_checkinteger luaL_checkinteger(lua_State *L, int arg) [lua_Integer]\nChecks whether the function argument `arg` is an integer (or can be converted to\nan integer) and returns this integer.\n
+luaL_checklstring luaL_checklstring(lua_State *L, int arg, size_t *l) [const char*]\nChecks whether the function argument `arg` is a string and returns this string;\nif `l` is not `NULL` fills its referent with the string's length.\n\nThis function uses `lua_tolstring` to get its result, so all conversions\nand caveats of that function apply here.\n
+luaL_checknumber luaL_checknumber(lua_State *L, int arg) [lua_Number]\nChecks whether the function argument `arg` is a number and returns this number\nconverted to a `lua_Number`.\n
luaL_checkoption luaL_checkoption(lua_State *L, int arg, const char *def, const char *const lst[]) [int]\nChecks whether the function argument `arg` is a string and searches for this\nstring in the array `lst` (which must be NULL-terminated). Returns the index\nin the array where the string was found. Raises an error if the argument\nis not a string or if the string cannot be found.\n\nIf `def` is not `NULL`, the function uses `def` as a default value when\nthere is no argument `arg` or when this argument is nil.\n\nThis is a useful function for mapping strings to C enums. (The usual\nconvention in Lua libraries is to use strings instead of numbers to select\noptions.)\n
luaL_checkstack luaL_checkstack(lua_State *L, int sz, const char *msg) [void]\nGrows the stack size to `top + sz` elements, raising an error if the stack\ncannot grow to that size. `msg` is an additional text to go into the error\nmessage (or `NULL` for no additional text).\n
luaL_checkstring luaL_checkstring(lua_State *L, int arg) [const char*]\nChecks whether the function argument `arg` is a string and returns this string.\n\nThis function uses `lua_tolstring` to get its result, so all conversions\nand caveats of that function apply here.\n
luaL_checktype luaL_checktype(lua_State *L, int arg, int t) [void]\nChecks whether the function argument `arg` has type `t`. See `lua_type` for\nthe encoding of types for `t`.\n
-luaL_checkudata luaL_checkudata(lua_State *L, int arg, const char *tname) [void*]\nChecks whether the function argument `arg` is a userdata of the type `tname`\n(see `luaL_newmetatable`) and returns the userdata address (see\n`lua_touserdata`).\n
-luaL_checkversion luaL_checkversion(lua_State *L) [void]\nChecks whether the core running the call, the core that created the Lua state,\nand the code making the call are all using the same version of Lua. Also checks\nwhether the core running the call and the core that created the Lua state are\nusing the same address space.\n
-luaL_dofile luaL_dofile(lua_State *L, const char *filename) [int]\nLoads and runs the given file. It is defined as the following macro:\n\n (luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\nIt returns false if there are no errors or true in case of errors.\n
-luaL_dostring luaL_dostring(lua_State *L, const char *str) [int]\nLoads and runs the given string. It is defined as the following macro:\n\n (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\nIt returns false if there are no errors or true in case of errors.\n
+luaL_checkudata luaL_checkudata(lua_State *L, int arg, const char *tname) [void*]\nChecks whether the function argument `arg` is a userdata of the type `tname`\n(see `luaL_newmetatable`) and returns the userdata's memory-block address (see\n`lua_touserdata`).\n
+luaL_checkversion luaL_checkversion(lua_State *L) [void]\nChecks whether the code making the call and the Lua library being called are \nusing the same version of Lua and the same numeric types.\n
+luaL_dofile luaL_dofile(lua_State *L, const char *filename) [int]\nLoads and runs the given file. It is defined as the following macro:\n\n (luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\nIt returns `LUA_OK` if there are no errors, or an error code in case of errors\n(see §4.4.1).\n
+luaL_dostring luaL_dostring(lua_State *L, const char *str) [int]\nLoads and runs the given string. It is defined as the following macro:\n\n (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\nIt returns `LUA_OK` if there are no errors, or an error code in case of errors\n(see §4.4.1).\n
luaL_error luaL_error(lua_State *L, const char *fmt, ...) [int]\nRaises an error. The error message format is given by `fmt` plus any extra\narguments, following the same rules of `lua_pushfstring`. It also adds at\nthe beginning of the message the file name and the line number where the\nerror occurred, if this information is available.\n\nThis function never returns, but it is an idiom to use it in C functions as\n`return luaL_error(args)`.\n
luaL_execresult luaL_execresult(lua_State *L, int stat) [int]\nThis function produces the return values for process-related functions in the\nstandard library (`os.execute` and `io.close`).\n
luaL_fileresult luaL_fileresult(lua_State *L, int stat, const char *fname) [int]\nThis function produces the return values for file-related functions in the\nstandard library (`io.open`, `os.rename`, `file:seek`, etc.).\n
luaL_getmetafield luaL_getmetafield(lua_State *L, int obj, const char *e) [int]\nPushes onto the stack the field `e` from the metatable of the object at index\n`obj` and returns the type of pushed value. If the object does not have a metatable, or if the metatable does\nnot have this field, pushes nothing and returns `LUA_TNIL`.\n
-luaL_getmetatable luaL_getmetatable(lua_State *L, const char *tname) [int]\nPushes onto the stack the metatable associated with name `tname` in the\nregistry (see `luaL_newmetatable`). If there is no metatable associated with\n`tname`, returns false and pushes `nil`. \n
+luaL_getmetatable luaL_getmetatable(lua_State *L, const char *tname) [int]\nPushes onto the stack the metatable associated with the name `tname` in the\nregistry (see `luaL_newmetatable`), or nil if there is no metatable associated \nwith that name. Returns the type of that pushed value.\n
luaL_getsubtable luaL_getsubtable(lua_State *L, int idx, const char *fname) [int]\nEnsures that the value `t[fname]`, where `t` is the value at index `idx`, is\na table, and pushes that table onto the stack. Returns true if it finds a\nprevious table there and false if it creates a new table.\n
-luaL_gsub luaL_gsub(lua_State *L, const char *s, const char *p, const char *r) [const char*]\nCreates a copy of string `s` by replacing any occurrence of the string `p`\nwith the string `r`. Pushes the resulting string on the stack and returns it.\n
-luaL_len luaL_len(lua_State *L, int index) [lua_Integer]\nReturns the "length" of the value at the given index as a number; it is\nequivalent to the '`#`' operator in Lua (see §3.4.7). Raises an error if the\nresult of the operation is not an integer. (This case only can happen through\nmetamethods.)\n
+luaL_gsub luaL_gsub(lua_State *L, const char *s, const char *p, const char *r) [const char*]\nCreates a copy of string `s`, replacing any occurrence of the string `p` with \nthe string `r`. Pushes the resulting string on the stack and returns it.\n
+luaL_len luaL_len(lua_State *L, int index) [lua_Integer]\nReturns the "length" of the value at the given index as a number; it is\nequivalent to the '`#`' operator in Lua (see §3.4.7). Raises an error if the\nresult of the operation is not an integer. (This case can only happen through\nmetamethods.)\n
luaL_loadbuffer luaL_loadbuffer(lua_State *L, const char *buff, size_t sz, const char *name) [int]\nEquivalent to `luaL_loadbufferx` with `mode` equal to `NULL`.\n
-luaL_loadbufferx luaL_loadbufferx(lua_State *L, const char *buff, size_t sz, const char *name, const char *mode) [int]\nLoads a buffer as a Lua chunk. This function uses `lua_load` to load the\nchunk in the buffer pointed to by `buff` with size `sz`.\n\nThis function returns the same results as `lua_load`. `name` is the chunk\nname, used for debug information and error messages. The string `mode` works as\nin function `lua_load`.\n
+luaL_loadbufferx luaL_loadbufferx(lua_State *L, const char *buff, size_t sz, const char *name, const char *mode) [int]\nLoads a buffer as a Lua chunk. This function uses `lua_load` to load the\nchunk in the buffer pointed to by `buff` with size `sz`.\n\nThis function returns the same results as `lua_load`. `name` is the chunk\nname, used for debug information and error messages. The string `mode` works as\nin the function `lua_load`.\n
luaL_loadfile luaL_loadfile(lua_State *L, const char *filename) [int]\nEquivalent to `luaL_loadfilex` with `mode` equal to `NULL`.\n
-luaL_loadfilex luaL_loadfilex(lua_State *L, const char *filename, const char *mode) [int]\nLoads a file as a Lua chunk. This function uses `lua_load` to load the chunk\nin the file named `filename`. If `filename` is `NULL`, then it loads from the\nstandard input. The first line in the file is ignored if it starts with a `#`.\n\nThe string `mode` works as in function `lua_load`.\n\nThis function returns the same results as `lua_load`, but it has an extra\nerror code `LUA_ERRFILE` if it cannot open/read the file or the file has a wrong\nmode.\n\nAs `lua_load`, this function only loads the chunk; it does not run it.\n
+luaL_loadfilex luaL_loadfilex(lua_State *L, const char *filename, const char *mode) [int]\nLoads a file as a Lua chunk. This function uses `lua_load` to load the chunk\nin the file named `filename`. If `filename` is `NULL`, then it loads from the\nstandard input. The first line in the file is ignored if it starts with a `#`.\n\nThe string `mode` works as in the function `lua_load`.\n\nThis function returns the same results as `lua_load` or `LUA_ERRFILE` for \nfile-related errors.\n\nAs `lua_load`, this function only loads the chunk; it does not run it.\n
luaL_loadstring luaL_loadstring(lua_State *L, const char *s) [int]\nLoads a string as a Lua chunk. This function uses `lua_load` to load the\nchunk in the zero-terminated string `s`.\n\nThis function returns the same results as `lua_load`.\n\nAlso as `lua_load`, this function only loads the chunk; it does not run it.\n
-luaL_newlib luaL_newlib(lua_State *L, const luaL_Reg l[]) [void]\nCreates a new table and registers there the functions in list `l`.\n\nIt is implemented as the following macro:\n\n (luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))\n \nThe array `l` must be the actual array, not a pointer to it.\n
+luaL_newlib luaL_newlib(lua_State *L, const luaL_Reg l[]) [void]\nCreates a new table and registers there the functions in the list `l`.\n\nIt is implemented as the following macro:\n\n (luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))\n \nThe array `l` must be the actual array, not a pointer to it.\n
luaL_newlibtable luaL_newlibtable(lua_State *L, const luaL_Reg l[]) [void]\nCreates a new table with a size optimized to store all entries in the array `l`\n(but does not actually store them). It is intended to be used in conjunction\nwith `luaL_setfuncs` (see `luaL_newlib`).\n\nIt is implemented as a macro. The array `l` must be the actual array, not a\npointer to it.\n
-luaL_newmetatable luaL_newmetatable(lua_State *L, const char *tname) [int]\nIf the registry already has the key `tname`, returns 0. Otherwise, creates a\nnew table to be used as a metatable for userdata, adds to this new table the\npair `__name = tname`, adds to the registry the pair `[tname] = new table`, and\nreturns 1. (The entry `__name` is used by some error-reporting functions.)\n\nIn both cases pushes onto the stack the final value associated with `tname`\nin the registry.\n
-luaL_newstate luaL_newstate(void) [lua_State*]\nCreates a new Lua state. It calls `lua_newstate` with an allocator based\non the standard C `realloc` function and then sets a panic function (see\n`lua_atpanic`) that prints an error message to the standard error output in\ncase of fatal errors.\n\nReturns the new state, or `NULL` if there is a memory allocation error.\n
+luaL_newmetatable luaL_newmetatable(lua_State *L, const char *tname) [int]\nIf the registry already has the key `tname`, returns 0. Otherwise, creates a\nnew table to be used as a metatable for userdata, adds to this new table the\npair `__name = tname`, adds to the registry the pair `[tname] = new table`, and\nreturns 1.\n\nIn both cases, the function pushes onto the stack the final value associated \nwith `tname` in the registry.\n
+luaL_newstate luaL_newstate(void) [lua_State*]\nCreates a new Lua state. It calls `lua_newstate` with an allocator based\non the standard C allocation functions and then sets a warning function and a \npanic function (see §4.4) that print messages to the standard error output.\n\nReturns the new state, or `NULL` if there is a memory allocation error.\n
luaL_openlibs luaL_openlibs(lua_State *L) [void]\nOpens all standard Lua libraries into the given state.\n
-luaL_opt luaL_opt(L, func, arg, dflt);\nThis macro is defined as follows:\n (lua_isnoneornil(L,(arg)) ? (dflt) : func(L,(arg)))\nIn words, if the argument `arg` is nil or absent, the macro results in the\ndefault `dflt`. Otherwise, it results in the result of calling `func` with the\nstate `L` and the argument index `arg` as parameters. Note that it evaluates the\nexpression `dflt` only if needed. \n
-luaL_optinteger luaL_optinteger(lua_State *L, int arg, lua_Integer d) [lua_Integer]\nIf the function argument `arg` is an integer (or convertable to an integer),\nreturns this integer. If this argument is absent or is nil, returns `d`.\nOtherwise, raises an error.\n
-luaL_optlstring luaL_optlstring(lua_State *L, int arg, const char *d, size_t *l) [const char*]\nIf the function argument `arg` is a string, returns this string. If this\nargument is absent or is nil, returns `d`. Otherwise, raises an error.\n\nIf `l` is not `NULL`, fills the position `*l` with the result's length. If the\nresult is `NULL` (only possible when returning `d` and `d == NULL`), its length\nis considered zero.\n
-luaL_optnumber luaL_optnumber(lua_State *L, int arg, lua_Number d) [lua_Number]\nIf the function argument `arg` is a number, returns this number. If this\nargument is absent or is nil, returns `d`. Otherwise, raises an error.\n
+luaL_opt luaL_opt(L, func, arg, dflt);\nThis macro is defined as follows:\n (lua_isnoneornil(L,(arg)) ? (dflt) : func(L,(arg)))\nIn words, if the argument `arg` is nil or absent, the macro results in the\ndefault `dflt`. Otherwise, it results in the result of calling `func` with the\nstate `L` and the argument index `arg` as parameters. Note that it evaluates \nthe expression `dflt` only if needed.\n
+luaL_optinteger luaL_optinteger(lua_State *L, int arg, lua_Integer d) [lua_Integer]\nIf the function argument `arg` is an integer (or it is convertable to an \ninteger), returns this integer. If this argument is absent or is nil, returns \n`d`. Otherwise, raises an error.\n
+luaL_optlstring luaL_optlstring(lua_State *L, int arg, const char *d, size_t *l) [const char*]\nIf the function argument `arg` is a string, returns this string. If this\nargument is absent or is nil, returns `d`. Otherwise, raises an error.\n\nIf `l` is not `NULL`, fills its referent with the result's length. If the\nresult is `NULL` (only possible when returning `d` and `d == NULL`), its length\nis considered zero.\n
+luaL_optnumber luaL_optnumber(lua_State *L, int arg, lua_Number d) [lua_Number]\nIf the function argument `arg` is a number, returns this number as a \n`lua_Number`. If this argument is absent or is nil, returns `d`. Otherwise, \nraises an error.\n
luaL_optstring luaL_optstring(lua_State *L, int arg, const char *d) [const char*]\nIf the function argument `arg` is a string, returns this string. If this\nargument is absent or is nil, returns `d`. Otherwise, raises an error.\n
luaL_prepbuffer luaL_prepbuffer(luaL_Buffer *B) [char*]\nEquivalent to `luaL_prepbuffsize` with the predefined size `LUAL_BUFFERSIZE`.\n
luaL_prepbuffsize luaL_prepbuffsize(luaL_Buffer *B, size_t sz) [char*]\nReturns an address to a space of size `LUAL_BUFFERSIZE` where you can copy\na string to be added to buffer `B` (see `luaL_Buffer`). After copying the\nstring into this space you must call `luaL_addsize` with the size of the\nstring to actually add it to the buffer.\n
+luaL_pushfail luaL_pushfail(lua_State *L) [void]\nPushes the fail value onto the stack (see §6).\n
luaL_pushresult luaL_pushresult(luaL_Buffer *B) [void]\nFinishes the use of buffer `B` leaving the final string on the top of\nthe stack.\n
luaL_pushresultsize luaL_pushresultsize(luaL_Buffer *B, size_t sz) [void]\nEquivalent to the sequence `luaL_addsize`, `luaL_pushresult`.\n
-luaL_ref luaL_ref(lua_State *L, int t) [int]\nCreates and returns a _reference_, in the table at index `t`, for the object\nat the top of the stack (and pops the object).\n\nA reference is a unique integer key. As long as you do not manually add\ninteger keys into table `t`, `luaL_ref` ensures the uniqueness of the key\nit returns. You can retrieve an object referred by reference `r` by calling\n`lua_rawgeti(L, t, r)`. Function `luaL_unref` frees a reference and its\nassociated object.\n\nIf the object at the top of the stack is nil, `luaL_ref` returns the constant\n`LUA_REFNIL`. The constant `LUA_NOREF` is guaranteed to be different from\nany reference returned by `luaL_ref`.\n
+luaL_ref luaL_ref(lua_State *L, int t) [int]\nCreates and returns a _reference_, in the table at index `t`, for the object\non the top of the stack (and pops the object).\n\nA reference is a unique integer key. As long as you do not manually add\ninteger keys into the table `t`, `luaL_ref` ensures the uniqueness of the key\nit returns. You can retrieve an object referred by the reference `r` by calling\n`lua_rawgeti(L, t, r)`. The function `luaL_unref` frees a reference.\n\nIf the object on the top of the stack is nil, `luaL_ref` returns the constant\n`LUA_REFNIL`. The constant `LUA_NOREF` is guaranteed to be different from\nany reference returned by `luaL_ref`.\n
luaL_Reg luaL_Reg [struct]\ntypedef struct luaL_Reg {\n const char *name;\n lua_CFunction func;\n} luaL_Reg;\n\nType for arrays of functions to be registered by `luaL_setfuncs\nis the function name and `func` is a pointer to the function. Any array of\n`luaL_Reg` must end with a sentinel entry in which both `name` and `func`\nare `NULL`.\n
-luaL_requiref luaL_requiref(lua_State *L, const char *modname, lua_CFunction openf, int glb) [void]\nIf `modname` is not already present in `package.loaded`, calls function `openf`\nwith string `modname` as an argument and sets the call result in\n`package.loaded[modname]`, as if that function has been called through\n`require`.\n\nIf `glb` is true, also stores the module into global `modname`.\n\nLeaves a copy of the module on the stack.\n
-luaL_setfuncs luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup) [void]\nRegisters all functions in the array `l` (see `luaL_Reg`) into the table on the\ntop of the stack (below optional upvalues, see next).\n\nWhen `nup` is not zero, all functions are created sharing `nup` upvalues, which\nmust be previously pushed on the stack on top of the library table. These\nvalues are popped from the stack after the registration.\n
-luaL_setmetatable luaL_setmetatable(lua_State *L, const char *tname) [void]\nSets the metatable of the object at the top of the stack as the metatable\nassociated with name `tname` in the registry (see `luaL_newmetatable`).\n
-luaL_Stream luaL_Stream [typedef struct luaL_Stream {FILE *f; lua_CFunction closef;}]\nThe standard representation for file handles, which is used by the standard I/O\nlibrary.\n\nA file handle is implemented as a full userdata, with a metatable called\n`LUA_FILEHANDLE` (where `LUA_FILEHANDLE` is a macro with the actual metatable's\nname). The metatable is created by the I/O library (see `luaL_newmetatable`).\n\nThis userdata must start with the structure `luaL_Stream`; it can contain other\ndata after this initial structure. Field `f` points to the corresponding C\nstream (or it can be `NULL` to indicate an incompletely created handle). Field\n`closef` points to a Lua function that will be called to close the stream when\nthe handle is closed or collected; this function receives the file handle as its\nsole argument and must return either **true** (in case of success) or **nil**\nplus an error message (in case of error). Once Lua calls this field, it changes\nthe field value to `NULL` to signal that the handle is closed.\n
+luaL_requiref luaL_requiref(lua_State *L, const char *modname, lua_CFunction openf, int glb) [void]\nIf `package.loaded[modname]` is not true, calls the function `openf` with the\nstring `modname` as an argument and sets the call result to\n`package.loaded[modname]`, as if that function has been called through\n`require`.\n\nIf `glb` is true, also stores the module into the global `modname`.\n\nLeaves a copy of the module on the stack.\n
+luaL_setfuncs luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup) [void]\nRegisters all functions in the array `l` (see `luaL_Reg`) into the table on the\ntop of the stack (below optional upvalues, see next).\n\nWhen `nup` is not zero, all functions are created with `nup` upvalues, \ninitialized with copies of the `nup` values previously pushed on the stack on \ntop of the library table. These values are popped from the stack after the \nregistration.\n
+luaL_setmetatable luaL_setmetatable(lua_State *L, const char *tname) [void]\nSets the metatable of the object on the top of the stack as the metatable\nassociated with name `tname` in the registry (see `luaL_newmetatable`).\n
+luaL_Stream luaL_Stream [typedef struct luaL_Stream {FILE *f; lua_CFunction closef;}]\nThe standard representation for file handles used by the standard I/O library.\n\nA file handle is implemented as a full userdata, with a metatable called\n`LUA_FILEHANDLE` (where `LUA_FILEHANDLE` is a macro with the actual metatable's\nname). The metatable is created by the I/O library (see `luaL_newmetatable`).\n\nThis userdata must start with the structure `luaL_Stream`; it can contain other\ndata after this initial structure. The field `f` points to the corresponding C\nstream (or it can be `NULL` to indicate an incompletely created handle). The\nfield `closef` points to a Lua function that will be called to close the stream \nwhen the handle is closed or collected; this function receives the file handle \nas its sole argument and must return either a true value, in case of success, or \na false value plus an error message, in case of error. Once Lua calls this \nfield, it changes the field value to `NULL` to signal that the handle is closed.\n
luaL_testudata luaL_testudata(lua_State *L, int arg, const char *tname) [void]\nThis function works like `luaL_checkudata`, except that, when the test fails,\nit returns `NULL` instead of raising an error.\n
-luaL_tolstring luaL_tolstring(lua_State *L, int idx, size_t *len) [const char*]\nConverts any Lua value at the given index to a C string in a reasonable format.\nThe resulting string is pushed onto the stack and also returned by the function.\nIf `len` is not `NULL`, the function also sets `*len` with the string length.\n\nIf the value has a metatable with a `__tostring` field, then `luaL_tolstring`\ncalls the corresponding metamethod with the value as argument, and uses the\nresult of the call as its result.\n
-luaL_traceback luaL_traceback(lua_State *L, lua_State *L1, const char *msg, int level) [void]\nCreates and pushes a traceback of the stack `L1`. If `msg` is not `NULL` it is\nappended at the beginning of the traceback. The `level` parameter tells at\nwhich level to start the traceback.\n
+luaL_tolstring luaL_tolstring(lua_State *L, int idx, size_t *len) [const char*]\nConverts any Lua value at the given index to a C string in a reasonable format.\nThe resulting string is pushed onto the stack and also returned by the function\n(see §4.1.3). If `len` is not `NULL`, the function also sets `*len` with the \nstring length.\n\nIf the value has a metatable with a `__tostring` field, then `luaL_tolstring`\ncalls the corresponding metamethod with the value as argument, and uses the\nresult of the call as its result.\n
+luaL_traceback luaL_traceback(lua_State *L, lua_State *L1, const char *msg, int level) [void]\nCreates and pushes a traceback of the stack `L1`. If `msg` is not `NULL`, it is\nappended at the beginning of the traceback. The `level` parameter tells at\nwhich level to start the traceback.\n
+luaL_typeerror luaL_typeerror(lua_State *L, int arg, const char *tname) [const char*]\nRaises a type error for the argument `arg` of the C function that called it,\nusing a standard message; `tname` is a "name" for the expected type. This \nfunction never returns.\n
luaL_typename luaL_typename(lua_State *L, int index) [const char*]\nReturns the name of the type of the value at the given index.\n
-luaL_unref luaL_unref(lua_State *L, int t, int ref) [void]\nReleases reference `ref` from the table at index `t` (see `luaL_ref`).\nThe entry is removed from the table, so that the referred object can be\ncollected. The reference `ref` is also freed to be used again.\n\nIf `ref` is `LUA_NOREF` or `LUA_REFNIL`, `luaL_unref` does nothing.\n
+luaL_unref luaL_unref(lua_State *L, int t, int ref) [void]\nReleases the reference `ref` from the table at index `t` (see `luaL_ref`).\nThe entry is removed from the table, so that the referred object can be\ncollected. The reference `ref` is also freed to be used again.\n\nIf `ref` is `LUA_NOREF` or `LUA_REFNIL`, `luaL_unref` does nothing.\n
luaL_where luaL_where(lua_State *L, int lvl) [void]\nPushes onto the stack a string identifying the current position of the\ncontrol at level `lvl` in the call stack. Typically this string has the\nfollowing format:\n\n _chunkname_:_currentline_:\n\nLevel 0 is the running function, level 1 is the function that called the\nrunning function, etc.\n\nThis function is used to build a prefix for error messages.\n
diff --git a/modules/lua/api b/modules/lua/api
index d1d1ab65..7972af7c 100644
--- a/modules/lua/api
+++ b/modules/lua/api
@@ -15,13 +15,13 @@ S lpeg.S(string)\nReturns a pattern that matches any single character that appea
V lpeg.V(v)\nThis operation creates a non-terminal (a variable) for a grammar. The created\nnon-terminal refers to the rule indexed by `v` in the enclosing grammar. (See\nGrammars for details.)
_G _G._G (module)\nLua _G module.
_G _G._G (table)\nA global variable (not a function) that holds the global environment\n(see §2.2). Lua itself does not use this variable; changing its value does\nnot affect any environment, nor vice versa.
-_VERSION _G._VERSION (string)\nA global variable (not a function) that holds a string containing the\nrunning Lua version. The current value of this variable is "`Lua 5.3`".
-abs math.abs(x)\nReturns the absolute value of `x`. (integer/float)
+_VERSION _G._VERSION (string)\nA global variable (not a function) that holds a string containing the\nrunning Lua version. The current value of this variable is "`Lua 5.4`".
+abs math.abs(x)\nReturns the maximum value between `x` and `-x`. (integer/float)
acos math.acos(x)\nReturns the arc cosine of `x` (in radians).
arshift bit32.arshift(x, disp)\nReturns the number `x` shifted `disp` bits to the right. The number `disp`\nmay be any representable integer. Negative displacements shift to the left.\n\nThis shift operation is what is called arithmetic shift. Vacant bits on the\nleft are filled with copies of the higher bit of `x`; vacant bits on the\nright are filled with zeros. In particular, displacements with absolute\nvalues higher than 31 result in zero or `0xFFFFFFFF` (all original bits are\nshifted out).\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
asin math.asin(x)\nReturns the arc sine of `x` (in radians).
-assert _G.assert(v [, message])\nCalls `error` if the value of its argument `v` is false (i.e., nil or false);\notherwise, returns all its arguments. In case of error, `message` is the\nerror object; when absent, it defaults to "assertion failed!".
-atan math.atan(y [, x])\nReturns the arc tangent of `y/x` (in radians), but uses the signs\nof both parameters to find the quadrant of the result. (It also handles\ncorrectly the case of `x` being zero.)\n\nThe default value for `x` is 1, so that the call `math.atan(y)` returns the\narc tangent of `y`.
+assert _G.assert(v [, message])\nRaises an error if the value of its argument `v` is false (i.e., nil or\nfalse); otherwise, returns all its arguments. In case of error, `message` is\nthe error object; when absent, it defaults to "assertion failed!".
+atan math.atan(y [, x])\nReturns the arc tangent of `y/x` (in radians), but uses the signs\nof both parameters to find the quadrant of the result. It also handles\ncorrectly the case of `x` being zero.\n\nThe default value for `x` is 1, so that the call `math.atan(y)` returns the\narc tangent of `y`.
atan2 math.atan2(y, x)\nReturns the arc tangent of `y/x` (in radians), but uses the signs\nof both parameters to find the quadrant of the result. (It also handles\ncorrectly the case of `x` being zero.)\n\nDeprecated in Lua 5.3.
attributes lfs.attributes(filepath [, aname | atable])\nReturns a table with the file attributes corresponding to filepath (or nil\nfollowed by an error message in case of error). If the second optional\nargument is given and is a string, then only the value of the named attribute\nis returned (this use is equivalent to lfs.attributes(filepath)[aname], but\nthe table is not created and only one attribute is retrieved from the O.S.).\nIf a table is passed as the second argument, it is filled with attributes and\nreturned instead of a new table. The attributes are described as follows;\nattribute mode is a string, all the others are numbers, and the time related\nattributes use the same time reference of os.time:\n dev: on Unix systems, this represents the device that the inode resides on.\n On Windows systems, represents the drive number of the disk containing\n the file\n ino: on Unix systems, this represents the inode number. On Windows systems\n this has no meaning\n mode: string representing the associated protection mode (the values could\n be file, directory, link, socket, named pipe, char device, block\n device or other)\n nlink: number of hard links to the file\n uid: user-id of owner (Unix only, always 0 on Windows)\n gid: group-id of owner (Unix only, always 0 on Windows)\n rdev: on Unix systems, represents the device type, for special file inodes.\n On Windows systems represents the same as dev\n access: time of last access\n modification: time of last data modification\n change: time of last file status change\n size: file size, in bytes\n permissions: file permissions string\n blocks: block allocated for file; (Unix only)\n blksize: optimal file system I/O blocksize; (Unix only)\n\nThis function uses stat internally thus if the given filepath is a symbolic\nlink, it is followed (if it points to another link the chain is followed\nrecursively) and the information is about the file it refers to. To obtain\ninformation about the link itself, see function lfs.symlinkattributes.
band bit32.band(...)\nReturns the bitwise "and" of its operands.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
@@ -30,76 +30,77 @@ bnot bit32.bnot(x)\nReturns the bitwise negation of `x`. For any integer `x`, th
bor bit32.bor(...)\nReturns the bitwise "or" of its operands.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
btest bit32.btest(...)\nReturns a boolean signaling whether the bitwise "and" of its operands is\ndifferent from zero.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
byte string.byte(s [, i [, j]])\nReturns the internal numerical codes of the characters `s[i]`, `s[i+1]`,\n···, `s[j]`. The default value for `i` is 1; the default value for `j`\nis `i`. These indices are corrected following the same rules of function\n`string.sub`.\n\nNumerical codes are not necessarily portable across platforms.
-ceil math.ceil(x)\nReturns the smallest integral value larger than or equal to `x`.
+ceil math.ceil(x)\nReturns the smallest integral value greater than or equal to `x`.
char string.char(···)\nReceives zero or more integers. Returns a string with length equal to\nthe number of arguments, in which each character has the internal numerical\ncode equal to its corresponding argument.\n\nNumerical codes are not necessarily portable across platforms.
char utf8.char(···)\nReceives zero or more integers, converts each one to its corresponding UTF-8\nbyte sequence and returns a string with the concatenation of all these\nsequences.\n\nNew in Lua 5.3.
-charpattern utf8.charpattern (string)\nThe pattern (a string, not a function) "\0-\x7F\xC2-\xF4*"\n(see §6.4.1), which matches exactly one UTF-8 byte sequence, assuming that\nthe subject is a valid UTF-8 string.\n\nNew in Lua 5.3.
+charpattern utf8.charpattern (string)\nThe pattern (a string, not a function) "\0-\x7F\xC2-\xFD*"\n(see §6.4.1), which matches exactly one UTF-8 byte sequence, assuming that\nthe subject is a valid UTF-8 string.\n\nNew in Lua 5.3.
chdir lfs.chdir(path)\nChanges the current working directory to the given path.\n\nReturns true in case of success or nil plus an error string.
-clock os.clock()\nReturns an approximation of the amount in seconds of CPU time used by\nthe program.
+clock os.clock()\nReturns an approximation of the amount in seconds of CPU time used by\nthe program, as returned by the underlying ISO C function `clock`.
+close coroutine.close(co)\nCloses coroutine `co`, that is, closes all its pending to-be-closed variables\nand puts the coroutine in a dead state. The given coroutine must be dead or\nsuspended. In case of error closing some variable, returns false plus the\nerror object; otherwise returns true.
close file:close()\nCloses `file`. Note that files are automatically closed when their\nhandles are garbage collected, but that takes an unpredictable amount of\ntime to happen.\n\nWhen closing a file handle created with `io.popen`, `file:close` returns the\nsame values returned by `os.execute`.
close io.close([file])\nEquivalent to `file:close()`. Without a `file`, closes the default\noutput file.
-codepoint utf8.codepoint(s [, i [, j]])\nReturns the codepoints (as integers) from all characters in `s` that start\nbetween byte position `i` and `j` (both included). The default for `i` is 1\nand for `j` is `i`. It raises an error if it meets any invalid byte sequence.\n\nNew in Lua 5.3.
-codes utf8.codes(s)\nReturns values so that the construction\n\n for p, c in utf8.codes(s) do *body* end\n\nwill iterate over all characters in string `s`, with `p` being the position\n(in bytes) and `c` the code point of each character. It raises an error if it\nmeets any invalid byte sequence.\n\nNew in Lua 5.3.
-collectgarbage _G.collectgarbage([opt [, arg]])\nThis function is a generic interface to the garbage collector. It\nperforms different functions according to its first argument, `opt`:\n "collect": performs a full garbage-collection cycle. This is the default\n option.\n "stop": stops automatic execution of the garbage collector.\n "restart": restarts automatic execution of the garbage collector.\n "count": returns the total memory in use by Lua in Kbytes. The value has a\n fractional part, so that it multiplied by 1024 gives the exact\n number of bytes in use by Lua (except for overflows).\n "step": performs a garbage-collection step. The step "size" is controlled\n by `arg`. With a zero value, the collector will perform one basic\n (indivisible) step. For non-zero values, the collector will perform\n as if that amount of memory (in KBytes) had been allocated by Lua.\n Returns true if the step finished a collection cycle.\n "setpause": sets `arg` as the new value for the *pause* of the collector\n (see §2.5). Returns the previous value for *pause*.\n "setstepmul": sets `arg` as the new value for the *step multiplier*\n of the collector (see §2.5). Returns the previous value for\n *step*.\n "isrunning": returns a boolean that tells whether the collector is running\n (i.e., not stopped).
+codepoint utf8.codepoint(s [, i [, j [, lax]]])\nReturns the codepoints (as integers) from all characters in `s` that start\nbetween byte position `i` and `j` (both included). The default for `i` is 1\nand for `j` is `i`. It raises an error if it meets any invalid byte sequence.\n\nThis function only accepts valid sequences (well formed and not overlong).\nBy default, it only accepts byte sequences that result in valid Unicode code\npoints, rejecting values greater than `10FFFF` and surrogates. The boolean\nargument `lax` lifts these checks, so that all values up to `0x7FFFFFFF` are\naccepted. (Not well formed and overlong sequences are still rejected.)\n\nNew in Lua 5.3.
+codes utf8.codes(s [, lax])\nReturns values so that the construction\n\n for p, c in utf8.codes(s) do *body* end\n\nwill iterate over all UTF-8 characters in string `s`, with `p` being the\nposition (in bytes) and `c` the code point of each character. It raises an\nerror if it meets any invalid byte sequence.\n\nThis function only accepts valid sequences (well formed and not overlong).\nBy default, it only accepts byte sequences that result in valid Unicode code\npoints, rejecting values greater than `10FFFF` and surrogates. The boolean\nargument `lax` lifts these checks, so that all values up to `0x7FFFFFFF` are\naccepted. (Not well formed and overlong sequences are still rejected.)\n\nNew in Lua 5.3.
+collectgarbage _G.collectgarbage([opt [, arg]])\nThis function is a generic interface to the garbage collector. It\nperforms different functions according to its first argument, `opt`:\n "collect": performs a full garbage-collection cycle. This is the default\n option.\n "stop": stops automatic execution of the garbage collector.\n "restart": restarts automatic execution of the garbage collector.\n "count": returns the total memory in use by Lua in Kbytes. The value has a\n fractional part, so that it multiplied by 1024 gives the exact\n number of bytes in use by Lua.\n "step": performs a garbage-collection step. The step "size" is controlled\n by `arg`. With a zero value, the collector will perform one basic\n (indivisible) step. For non-zero values, the collector will perform\n as if that amount of memory (in Kbytes) had been allocated by Lua.\n Returns true if the step finished a collection cycle.\n "isrunning": returns a boolean that tells whether the collector is running\n (i.e., not stopped).\n "incremental": change the collector mode to incremental. This option can be\n followed by three numbers: the garbage-collector pause, the\n step multiplier, and the step size (see §2.5.1). A zero means to not\n change that value.\n "generational": change the collector mode to generational. This option can\n be followed by two numbers: the garbage-collector minor\n multiplier and the major multiplier (see §2.5.2). A zero\n means to not change that value.\n\nSee §2.5 for more details about garbage collection and some of these options.
concat table.concat(list [, sep [, i [, j]]])\nGiven a list where all elements are strings or numbers, returns the string\n`list[i]..sep..list[i+1] ··· sep..list[j]`. The default value for `sep` is\nthe empty string, the default for `i` is 1, and the default for `j` is\n`#list`. If `i` is greater than `j`, returns the empty string.
config package.config (string)\nA string describing some compile-time configurations for packages. This\nstring is a sequence of lines:\n The first line is the directory separator string. Default is '`\`' for\n Windows and '`/`' for all other systems.\n The second line is the character that separates templates in a path.\n Default is '`;`'.\n The third line is the string that marks the substitution points in a\n template. Default is '`?`'.\n The fourth line is a string that, in a path in Windows, is replaced by\n the executable's directory. Default is '`!`'.\n The fifth line is a mark to ignore all text after it when building the\n `luaopen_` function name. Default is '`-`'.\n\nNew in Lua 5.2.
coroutine _G.coroutine (module)\nLua coroutine module.
cos math.cos(x)\nReturns the cosine of `x` (assumed to be in radians).
cosh math.cosh(x)\nReturns the hyperbolic cosine of `x`.\n\nDeprecated in Lua 5.3.
-cpath package.cpath (string)\nThe path used by `require` to search for a C loader.\nLua initializes the C path `package.cpath` in the same way it initializes\nthe Lua path `package.path`, using the environment variable `LUA_CPATH_5_3`\nor the environment variable `LUA_CPATH` or a default path defined in\n`luaconf.h`.
+cpath package.cpath (string)\nA string with the path used by `require` to search for a C loader.\nLua initializes the C path `package.cpath` in the same way it initializes\nthe Lua path `package.path`, using the environment variable `LUA_CPATH_5_4`\nor the environment variable `LUA_CPATH` or a default path defined in\n`luaconf.h`.
create coroutine.create(f)\nCreates a new coroutine, with body `f`. `f` must be a Lua\nfunction. Returns this new coroutine, an object with type `"thread"`.
currentdir lfs.currentdir()\nReturns a string with the current working directory or nil plus an error\nstring.
-date os.date([format [, time]])\nReturns a string or a table containing date and time, formatted according\nto the given string `format`.\n\nIf the `time` argument is present, this is the time to be formatted\n(see the `os.time` function for a description of this value). Otherwise,\n`date` formats the current time.\n\nIf `format` starts with '`!`', then the date is formatted in Coordinated\nUniversal Time. After this optional character, if `format` is the string\n"`*t`", then `date` returns a table with the following fields: `year`,\n`month` (1-12), `day` (1-31), `hour` (0-23), `min` (0-59), `sec` (0-61),\n`wday` (weekday, 1-7, Sunday is 1), `yday` (day of the year, 1-366), and\n`isdst` (daylight saving flag, a boolean). This last field may be absent if\nthe information is not available.\n\nIf `format` is not "`*t`", then `date` returns the date as a string,\nformatted according to the same rules as the ISO C function `strftime`.\n\nWhen called without arguments, `date` returns a reasonable date and time\nrepresentation that depends on the host system and on the current locale.\n(More specifically, `os.date()` is equivalent to `os.date("%c")`.)\n\nOn non-POSIX systems, this function may be not thread safe because of its\nreliance on C function `gmtime` and C function `localtime`.
+date os.date([format [, time]])\nReturns a string or a table containing date and time, formatted according\nto the given string `format`.\n\nIf the `time` argument is present, this is the time to be formatted\n(see the `os.time` function for a description of this value). Otherwise,\n`date` formats the current time.\n\nIf `format` starts with '`!`', then the date is formatted in Coordinated\nUniversal Time. After this optional character, if `format` is the string\n"`*t`", then `date` returns a table with the following fields: `year`,\n`month` (1-12), `day` (1-31), `hour` (0-23), `min` (0-59), `sec` (0-61, due\nto leap seconds), `wday` (weekday, 1-7, Sunday is 1), `yday` (day of the\nyear, 1-366), and `isdst` (daylight saving flag, a boolean). This last field\nmay be absent if the information is not available.\n\nIf `format` is not "`*t`", then `date` returns the date as a string,\nformatted according to the same rules as the ISO C function `strftime`.\n\nIf `format` is absent, it defaults to "`%c`", which gives a human-readable\ndate and time representation using the current locale.\n\nOn non-POSIX systems, this function may be not thread safe because of its\nreliance on C function `gmtime` and C function `localtime`.
debug _G.debug (module)\nLua debug module.
debug debug.debug()\nEnters an interactive mode with the user, running each string that\nthe user enters. Using simple commands and other debug facilities,\nthe user can inspect global and local variables, change their values,\nevaluate expressions, and so on. A line containing only the word `cont`\nfinishes this function, so that the caller continues its execution.\n\nNote that commands for `debug.debug` are not lexically nested within any\nfunction and so have no direct access to local variables.
deg math.deg(x)\nConverts the angle `x` from radians to degrees.
difftime os.difftime(t2, t1)\nReturns the difference, in seconds, from time `t1` to time `t2` (where the\ntimes are values returned by `os.time`). In POSIX, Windows, and some other\nsystems, this value is exactly `t2`*-*`t1`.
dir lfs.dir(path)\nLua iterator over the entries of a given directory. Each time the iterator is\ncalled with dir_obj it returns a directory entry's name as a string, or nil\nif there are no more entries. You can also iterate by calling dir_obj:next(),\nand explicitly close the directory before the iteration finished with\ndir_obj:close(). Raises an error if path is not a directory.
-dofile _G.dofile([filename])\nOpens the named file and executes its contents as a Lua chunk. When\ncalled without arguments,\n`dofile` executes the contents of the standard input (`stdin`). Returns\nall values returned by the chunk. In case of errors, `dofile` propagates\nthe error to its caller (that is, `dofile` does not run in protected mode).
-dump string.dump(function [, strip])\nReturns a string containing a binary representation (a _binary chunk_) of the\ngiven function, so that a later `load` on this string returns a copy of the\nfunction (but with new upvalues). If `strip` is a true value, the binary\nrepresentation is created without debug information about the function (local\nvariable names, lines, etc.).\n\nFunctions with upvalues have only their number of upvalues saved. When\n(re)loaded, those upvalues receive fresh instances containing nil. (You can\nuse the debug library to serialize and reload the upvalues of a function in a\nway adequate to your needs.)
-error _G.error(message [, level])\nTerminates the last protected function called and returns `message`\nas the error object. Function `error` never returns.\n\nUsually, `error` adds some information about the error position at the\nbeginning of the message, if the message is a string. The `level` argument\nspecifies how to get the error position. With level 1 (the default), the\nerror position is where the `error` function was called. Level 2 points the\nerror to where the function that called `error` was called; and so on.\nPassing a level 0 avoids the addition of error position information to the\nmessage.
+dofile _G.dofile([filename])\nOpens the named file and executes its content as a Lua chunk. When\ncalled without arguments,\n`dofile` executes the content of the standard input (`stdin`). Returns\nall values returned by the chunk. In case of errors, `dofile` propagates\nthe error to its caller. (That is, `dofile` does not run in protected mode.)
+dump string.dump(function [, strip])\nReturns a string containing a binary representation (a _binary chunk_) of the\ngiven function, so that a later `load` on this string returns a copy of the\nfunction (but with new upvalues). If `strip` is a true value, the binary\nrepresentation is created without debug information about the function (local\nvariable names, lines, etc.).\n\nFunctions with upvalues have only their number of upvalues saved. When\n(re)loaded, those upvalues receive fresh instances. (See the `load` function\nfor details about how these upvalues are initialized. You can use the debug\nlibrary to serialize and reload the upvalues of a function in a way adequate\nto your needs.)
+error _G.error(message [, level])\nRaises an error (see §2.3) with `message` as the error object. This function\nnever returns.\n\nUsually, `error` adds some information about the error position at the\nbeginning of the message, if the message is a string. The `level` argument\nspecifies how to get the error position. With level 1 (the default), the\nerror position is where the `error` function was called. Level 2 points the\nerror to where the function that called `error` was called; and so on.\nPassing a level 0 avoids the addition of error position information to the\nmessage.
execute os.execute([command])\nThis function is equivalent to the ISO C function `system`. It passes\n`command` to be executed by an operating system shell. Its first result is\n`true` if the command terminated successfully, or `nil` otherwise. After this\nfirst result the function returns a string plus a number, as follows:\n "exit": the command terminated normally; the following number is the exit\n status of the command.\n "signal": the command was terminated by a signal; the following number is\n the signal that terminated the command.\n\nWhen called without a `command`, `os.execute` returns a boolean that is true\nif a shell is available.
exit os.exit([code [, close]])\nCalls the ISO C function `exit` to terminate the host program. If `code` is\n`true`, the returned status is `EXIT_SUCCESS`; if `code` is `false`, the\nreturned status is `EXIT_FAILURE`; if `code` is a number, the returned status\nis this number. The default value for `code` is `true`.\n\nIf the optional second argument `close` is true, closes the Lua state before\nexiting.
exp math.exp(x)\nReturns the value *e^x*.
extract bit32.extract(n, field [, width])\nReturns the unsigned number formed by the bits `field` to `field + width - 1`\nfrom `n`. Bits are numbered from 0 (least significant) to 31 (most\nsignificant). All accessed bits must be in the range [0, 31].\n\nThe default for `width` is 1.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
-find string.find(s, pattern [, init [, plain]])\nLooks for the first match of `pattern` (see §6.4.1) in the string `s`. If it\nfinds a match, then `find` returns the indices of `s` where this occurrence\nstarts and ends; otherwise, it returns nil. A third, optional numerical\nargument `init` specifies where to start the search; its default value is 1\nand can be negative. A value of true as a fourth, optional argument `plain`\nturns off the pattern matching facilities, so the function does a plain\n"find substring" operation, with no characters in `pattern` being considered\nmagic. Note that if `plain` is given, then `init` must be given as well.\n\nIf the pattern has captures, then in a successful match the captured values\nare also returned, after the two indices.
-floor math.floor(x)\nReturns the largest integral value smaller than or equal to `x`.
+find string.find(s, pattern [, init [, plain]])\nLooks for the first match of `pattern` (see §6.4.1) in the string `s`. If it\nfinds a match, then `find` returns the indices of `s` where this occurrence\nstarts and ends; otherwise, it returns nil. A third, optional numerical\nargument `init` specifies where to start the search; its default value is 1\nand can be negative. A value of true as a fourth, optional argument `plain`\nturns off the pattern matching facilities, so the function does a plain\n"find substring" operation, with no characters in `pattern` being considered\nmagic.\n\nIf the pattern has captures, then in a successful match the captured values\nare also returned, after the two indices.
+floor math.floor(x)\nReturns the largest integral value less than or equal to `x`.
flush file:flush()\nSaves any written data to `file`.
flush io.flush()\nEquivalent to `io.output():flush()`.
fmod math.fmod(x, y)\nReturns the remainder of the division of `x` by `y` that rounds the\nquotient towards zero. (integer/float)
-format string.format(formatstring, ···)\nReturns a formatted version of its variable number of arguments following the\ndescription given in its first argument (which must be a string). The format\nstring follows the same rules as the ISO C function `sprintf`. The only\ndifferences are that the options/modifiers `*`, `h`, `L`, `l`, `n`, and `p`\nare not supported and that there is an extra option, `q`.\n\nThe `q` option formats a string between double quotes, using escape sequences\nwhen necessary to ensure that it can safely be read back by the Lua\ninterpreter. For instance, the call\n\n string.format('%q', 'a string with "quotes" and \\n new line')\n\nmay produce the string:\n\n "a string with \"quotes\" and \\n new line"\n\nOptions `A` and `a` (when available), `E`, `e`, `f`, `G`, and `g` all expect\na number as argument. Options `c`, `d`, `i`, `o`, `u`, `X`, and `x` expect an\ninteger. Option `q` expects a string. Option `s` expects a string; if its\nargument is not a string, it is converted to one following the same rules of\n`tostring`. If the option has any modifier (flags, width, length), the string\nargument should not contain zeros.
+format string.format(formatstring, ···)\nReturns a formatted version of its variable number of arguments following the\ndescription given in its first argument, which must be a string. The format\nstring follows the same rules as the ISO C function `sprintf`. The only\ndifferences are that the conversion specifiers and modifiers `*`, `h`, `L`,\n`l`, and `n` are not supported and that there is an extra specifier, `q`.\n\nThe specifier `q` formats booleans, nil, numbers, and strings in a way that\nthe result is a valid constant in Lua source code. Booleans and nil are\nwritten in the obvious way (`true`, `false`, `nil`). Floats are written in\nhexadecimal, to preserve full precision. A string is written between double\nquotes, using escape sequences when necessary to ensure that it can safely be\nread back by the Lua interpreter. For instance, the call\n\n string.format('%q', 'a string with "quotes" and \\n new line')\n\nmay produce the string:\n\n "a string with \"quotes\" and \\n new line"\n\nThis specifier does not support modifiers (flags, width, length).\n\nThe conversion specifiers `A` and `a` (when available), `E`, `e`, `f`, `G`,\nand `g` all expect a number as argument. The specifiers `c`, `d`, `i`, `o`,\n`u`, `X`, and `x` expect an integer. When Lua is compiled with a C89\ncompiler, the specifiers `A` and `a` (hexadecimal floats) do not support\nmodifiers.\n\nThe specifier `s` expects a string; if its argument is not a string, it is\nconverted to one following the same rules of `tostring`. If the specifier has\nany modifier, the corresponding string argument should not contain zeros.\n\nThe specifier `p` formats the pointer returned by `lua_topointer`. That gives\na unique string identifier for tables, userdata, threads, strings, and\nfunctions. For other values (numbers, nil, booleans), this specifier results\nin a string representing the pointer `NULL`.
frexp math.frexp(x)\nReturns `m` and `e` such that 'x = m2^e', `e` is an integer and the\nabsolute value of `m` is in the range *[0.5, 1)* (or zero when `x` is zero).\n\nDeprecated in Lua 5.3.
getenv os.getenv(varname)\nReturns the value of the process environment variable `varname`, or\nnil if the variable is not defined.
getfenv _G.getfenv([f])\nReturns the current environment in use by the function. `f` can be a Lua\nfunction or a number that specifies the function at that stack level:\nLevel 1 is the function calling `getfenv`. If the given function is not a\nLua function, or if `f` is 0, `getfenv` returns the global environment. The\ndefault for `f` is 1.\n\nDeprecated in Lua 5.2.
getfenv debug.getfenv(o)\nReturns the environment of object `o`.\n\nDeprecated in Lua 5.2.
-gethook debug.gethook([thread])\nReturns the current hook settings of the thread, as three values: the\ncurrent hook function, the current hook mask, and the current hook count\n(as set by the `debug.sethook` function).
-getinfo debug.getinfo([thread, ] f [, what])\nReturns a table with information about a function. You can give the\nfunction directly or you can give a number as the value of `f`, which means\nthe function running at level `f` of the call stack of the given thread:\nlevel 0 is the current function (`getinfo` itself); level 1 is the function\nthat called `getinfo` and so on. If `f` is a number larger than the number of\nactive functions, then `getinfo` returns nil.\n\nThe returned table can contain all the fields returned by `lua_getinfo`,\nwith the string `what` describing which fields to fill in. The default for\n`what` is to get all information available, except the table of valid\nlines. If present, the option '`f`' adds a field named `func` with\nthe function itself. If present, the option '`L`' adds a field named\n`activelines` with the table of valid lines.\n\nFor instance, the expression `debug.getinfo(1,"n").name` returns a table\nwith a name for the current function, if a reasonable name can be found,\nand the expression `debug.getinfo(print)` returns a table with all available\ninformation about the `print` function.
-getlocal debug.getlocal([thread, ] f, local)\nThis function returns the name and the value of the local variable with index\n`local` of the function at level `f` of the stack. This function accesses not\nonly explicit local variables, but also parameters, temporaries, etc.\n\nThe first parameter or local variable has index 1, and so on, following the\norder that they are declared in the code, counting only the variables that\nare active in the current scope of the function. Negative indices refer to\nvararg parameters; -1 is the first vararg parameter. The function returns nil\nif there is no variable with the given index, and raises an error when called\nwith a level out of range. (You can call `debug.getinfo` to check whether the\nlevel is valid.)\n\nVariable names starting with '(' (open parenthesis) represent variables with\nno known names (internal variables such as loop control variables, and\nvariables from chunks saved without debug information).\n\nThe parameter `f` may also be a function. In that case, `getlocal` returns\nonly the name of function parameters.
+gethook debug.gethook([thread])\nReturns the current hook settings of the thread, as three values: the\ncurrent hook function, the current hook mask, and the current hook count,\nas set by the `debug.sethook` function.\n\nReturns nil if there is no active hook.
+getinfo debug.getinfo([thread, ] f [, what])\nReturns a table with information about a function. You can give the\nfunction directly or you can give a number as the value of `f`, which means\nthe function running at level `f` of the call stack of the given thread:\nlevel 0 is the current function (`getinfo` itself); level 1 is the function\nthat called `getinfo` (except for tail calls, which do not count in the\nstack); and so on. If `f` is a number greater than the number of active\nfunctions, then `getinfo` returns nil.\n\nThe returned table can contain all the fields returned by `lua_getinfo`,\nwith the string `what` describing which fields to fill in. The default for\n`what` is to get all information available, except the table of valid\nlines. If present, the option '`f`' adds a field named `func` with\nthe function itself. If present, the option '`L`' adds a field named\n`activelines` with the table of valid lines.\n\nFor instance, the expression `debug.getinfo(1,"n").name` returns a table\nwith a name for the current function, if a reasonable name can be found,\nand the expression `debug.getinfo(print)` returns a table with all available\ninformation about the `print` function.
+getlocal debug.getlocal([thread, ] f, local)\nThis function returns the name and the value of the local variable with index\n`local` of the function at level `f` of the stack. This function accesses not\nonly explicit local variables, but also parameters and temporary values.\n\nThe first parameter or local variable has index 1, and so on, following the\norder that they are declared in the code, counting only the variables that\nare active in the current scope of the function. Compile-time constants may\nnot appear in this listing, if they were optimized away by the compiler.\nNegative indices refer to vararg parameters; -1 is the first vararg\nparameter. The function returns nil if there is no variable with the given\nindex, and raises an error when called with a level out of range. (You can\ncall `debug.getinfo` to check whether the level is valid.)\n\nVariable names starting with '(' (open parenthesis) represent variables with\nno known names (internal variables such as loop control variables, and\nvariables from chunks saved without debug information).\n\nThe parameter `f` may also be a function. In that case, `getlocal` returns\nonly the name of function parameters.
getmetatable _G.getmetatable(object)\nIf `object` does not have a metatable, returns nil. Otherwise, if the\nobject's metatable has a `__metatable` field, returns the associated\nvalue. Otherwise, returns the metatable of the given object.
getmetatable debug.getmetatable(value)\nReturns the metatable of the given `value` or nil if it does not have\na metatable.
-getregistry debug.getregistry()\nReturns the registry table (see §4.5).
-getupvalue debug.getupvalue(f, up)\nThis function returns the name and the value of the upvalue with index\n`up` of the function `f`. The function returns nil if there is no upvalue\nwith the given index.\n\nVariable names starting with '(' (open parenthesis) represent variables with\nno known names (variables from chunks saved without debug information).
-getuservalue debug.getuservalue(u)\nReturns the Lua value associated to `u`. If `u` is not a userdata, returns\nnil.\n\nNew in Lua 5.2.
-gmatch string.gmatch(s, pattern)\nReturns an iterator function that, each time it is called, returns the\nnext captures from `pattern` (see §6.4.1) over the string `s`. If `pattern`\nspecifies no captures, then the whole match is produced in each call.\n\nAs an example, the following loop will iterate over all the words from string\n`s`, printing one per line:\n\n s = "hello world from Lua"\n for w in string.gmatch(s, "%a+") do\n print(w)\n end\n\nThe next example collects all pairs `key=value` from the given string into a\ntable:\n\n t = {}\n s = "from=world, to=Lua"\n for k, v in string.gmatch(s, "(%w+)=(%w+)") do\n t[k] = v\n end\n\nFor this function, a caret '`^`' at the start of a pattern does not work as\nan anchor, as this would prevent the iteration.
-gsub string.gsub(s, pattern, repl [, n])\nReturns a copy of `s` in which all (or the first `n`, if given)\noccurrences of the `pattern` (see §6.4.1) have been replaced by a replacement\nstring specified by `repl`, which can be a string, a table, or a function.\n`gsub` also returns, as its second value, the total number of matches that\noccurred. The name `gsub` comes from "Global SUBstitution".\n\nIf `repl` is a string, then its value is used for replacement. The character\n`%` works as an escape character: any sequence in `repl` of the form `%d`,\nwith `d` between 1 and 9, stands for the value of the `d`-th captured\nsubstring. The sequence `%0` stands for the whole match. The sequence `%%`\nstands for a single `%`.\n\nIf `repl` is a table, then the table is queried for every match, using\nthe first capture as the key.\n\nIf `repl` is a function, then this function is called every time a match\noccurs, with all captured substrings passed as arguments, in order.\n\nIn any case, if the pattern specifies no captures, then it behaves as if the\nwhole pattern was inside a capture.\n\nIf the value returned by the table query or by the function call is a\nstring or a number, then it is used as the replacement string; otherwise,\nif it is false or nil, then there is no replacement (that is, the original\nmatch is kept in the string).\n\nHere are some examples:\n\n x = string.gsub("hello world", "(%w+)", "%1 %1")\n --> x="hello hello world world"\n x = string.gsub("hello world", "%w+", "%0 %0", 1)\n --> x="hello hello world"\n x = string.gsub("hello world from Lua", "(%w+)%s*(%w+)", "%2 %1")\n --> x="world hello Lua from"\n x = string.gsub("home = $HOME, user = $USER", "%$(%w+)", os.getenv)\n --> x="home = /home/roberto, user = roberto"\n x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s)\n return load(s)()\n end)\n --> x="4+5 = 9"\n local t = {name="lua", version="5.3"}\n x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t)\n --> x="lua-5.3.tar.gz"
-huge math.huge (number)\nThe float value `HUGE_VAL`, a value larger than any other numerical value.
+getregistry debug.getregistry()\nReturns the registry table (see §4.3).
+getupvalue debug.getupvalue(f, up)\nThis function returns the name and the value of the upvalue with index\n`up` of the function `f`. The function returns nil if there is no upvalue\nwith the given index.\n\n(For Lua functions, upvalues are the external local variables that the\nfunction uses, and that are consequently included in its closure.)\n\nFor C functions, this function uses the empty string `""` as a name for all\nupvalues.\n\nVariable name '`?`' (interrogation mark) represents variables with no known\nnames (variables from chunks saved without debug information).
+getuservalue debug.getuservalue(u, n)\nReturns the `n`-th user value associated to the userdata `u` plus a boolean,\nfalse, if the userdata does not have that value.\n\nNew in Lua 5.2.
+gmatch string.gmatch(s, pattern [, init])\nReturns an iterator function that, each time it is called, returns the\nnext captures from `pattern` (see §6.4.1) over the string `s`. If `pattern`\nspecifies no captures, then the whole match is produced in each call. A\nthird, optional argument `init` specifies where to start the search; its\ndefault value is 1 and can be negative.\n\nAs an example, the following loop will iterate over all the words from string\n`s`, printing one per line:\n\n s = "hello world from Lua"\n for w in string.gmatch(s, "%a+") do\n print(w)\n end\n\nThe next example collects all pairs `key=value` from the given string into a\ntable:\n\n t = {}\n s = "from=world, to=Lua"\n for k, v in string.gmatch(s, "(%w+)=(%w+)") do\n t[k] = v\n end\n\nFor this function, a caret '`^`' at the start of a pattern does not work as\nan anchor, as this would prevent the iteration.
+gsub string.gsub(s, pattern, repl [, n])\nReturns a copy of `s` in which all (or the first `n`, if given)\noccurrences of the `pattern` (see §6.4.1) have been replaced by a replacement\nstring specified by `repl`, which can be a string, a table, or a function.\n`gsub` also returns, as its second value, the total number of matches that\noccurred. The name `gsub` comes from "Global SUBstitution".\n\nIf `repl` is a string, then its value is used for replacement. The character\n`%` works as an escape character: any sequence in `repl` of the form `%d`,\nwith `d` between 1 and 9, stands for the value of the `d`-th captured\nsubstring; the sequence `%0` stands for the whole match; the sequence `%%`\nstands for a single `%`.\n\nIf `repl` is a table, then the table is queried for every match, using\nthe first capture as the key.\n\nIf `repl` is a function, then this function is called every time a match\noccurs, with all captured substrings passed as arguments, in order.\n\nIn any case, if the pattern specifies no captures, then it behaves as if the\nwhole pattern was inside a capture.\n\nIf the value returned by the table query or by the function call is a\nstring or a number, then it is used as the replacement string; otherwise,\nif it is false or nil, then there is no replacement (that is, the original\nmatch is kept in the string).\n\nHere are some examples:\n\n x = string.gsub("hello world", "(%w+)", "%1 %1")\n --> x="hello hello world world"\n x = string.gsub("hello world", "%w+", "%0 %0", 1)\n --> x="hello hello world"\n x = string.gsub("hello world from Lua", "(%w+)%s*(%w+)", "%2 %1")\n --> x="world hello Lua from"\n x = string.gsub("home = $HOME, user = $USER", "%$(%w+)", os.getenv)\n --> x="home = /home/roberto, user = roberto"\n x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s)\n return load(s)()\n end)\n --> x="4+5 = 9"\n local t = {name="lua", version="5.4"}\n x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t)\n --> x="lua-5.4.tar.gz"
+huge math.huge (number)\nThe float value `HUGE_VAL`, a value greater than any other numerical value.
input io.input([file])\nWhen called with a file name, it opens the named file (in text mode),\nand sets its handle as the default input file. When called with a file\nhandle, it simply sets this file handle as the default input file. When\ncalled without parameters, it returns the current default input file.\n\nIn case of errors this function raises the error, instead of returning an\nerror code.
-insert table.insert(list, [pos, ] value)\nInserts element `value` at position `pos` in `list`, shifting up the elements\n`list[pos], list[pos+1], ···, list[#list]`. The default value for `pos` is\n`#list+1`, so that a call `table.insert(t,x)` inserts `x` at the end of list\n`t`.
+insert table.insert(list, [pos, ] value)\nInserts element `value` at position `pos` in `list`, shifting up the elements\n`list[pos], list[pos+1], ···, list[#list]`. The default value for `pos` is\n`#list+1`, so that a call `table.insert(t,x)` inserts `x` at the end of the\nlist `t`.
io _G.io (module)\nLua io module.
-ipairs _G.ipairs(t)\nReturns three values (an iterator function, the table `t`, and 0) so that the\nconstruction\n\n for i,v in ipairs(t) do *body* end\n\nwill iterate over the key-value pairs (`1,t[1]`), (`2,t[2]`), ···, up to the\nfirst nil value.
-isyieldable coroutine.isyieldable()\nReturns true when the running coroutine can yield.\n\nA running coroutine is yieldable if it is not the main thread and it is not\ninside a non-yieldable C function.\n\nNew in Lua 5.3.
+ipairs _G.ipairs(t)\nReturns three values (an iterator function, the table `t`, and 0) so that the\nconstruction\n\n for i,v in ipairs(t) do *body* end\n\nwill iterate over the key-value pairs (`1,t[1]`), (`2,t[2]`), ···, up to the\nfirst absent index.
+isyieldable coroutine.isyieldable([co])\nReturns true when the coroutine `co` can yield. The default for `co` is the\nrunning coroutine.\n\nA coroutine is yieldable if it is not the main thread and it is not inside a\nnon-yieldable C function.\n\nNew in Lua 5.3.
ldexp math.ldexp(m, e)\nReturns 'm2^e' (`e` should be an integer).\n\nDeprecated in Lua 5.3.
len string.len(s)\nReceives a string and returns its length. The empty string `""` has\nlength 0. Embedded zeros are counted, so `"a\000bc\000"` has length 5.
-len utf8.len(s [, i [, j]])\nReturns the number of UTF-8 characters in string `s` that start between\npositions `i` and `j` (both inclusive). The default for `i` is 1 and for `j`\nis -1. If it finds any invalid byte sequence, returns a false value plus the\nposition of the first invalid byte.\n\nNew in Lua 5.3.
+len utf8.len(s [, i [, j [, lax]]])\nReturns the number of UTF-8 characters in string `s` that start between\npositions `i` and `j` (both inclusive). The default for `i` is 1 and for `j`\nis -1. If it finds any invalid byte sequence, returns nil plus the position\nof the first invalid byte.\n\nThis function only accepts valid sequences (well formed and not overlong).\nBy default, it only accepts byte sequences that result in valid Unicode code\npoints, rejecting values greater than `10FFFF` and surrogates. The boolean\nargument `lax` lifts these checks, so that all values up to `0x7FFFFFFF` are\naccepted. (Not well formed and overlong sequences are still rejected.)\n\nNew in Lua 5.3.
lfs _G.lfs (module)\nLua lfs module.
-lines file:lines(···)\nReturns an iterator function that, each time it is called, reads the file\naccording to the given formats. When no format is given, uses "l" as a\ndefault. As an example, the construction\n\n for c in file:lines(1) do *body* end\n\nwill iterate over all characters of the file, starting at the current\nposition. Unlike `io.lines`, this function does not close the file when the\nloop ends.\n\nIn case of errors this function raises the error, instead of returning an\nerror code.
-lines io.lines([filename, ···])\nOpens the given file name in read mode and returns an iterator function that\nworks like `file:lines(···)` over the opened file. When the iterator function\ndetects -- the end of file, it returns no values (to finish the loop) and\nautomatically closes the file.\n\nThe call `io.lines()` (with no file name) is equivalent to\n`io.input():lines("l")`; that is, it iterates over the lines of the default\ninput file. In this case it does not close the file when the loop ends.\n\nIn case of errors this function raises the error, instead of returning an\nerror code.
+lines file:lines(···)\nReturns an iterator function that, each time it is called, reads the file\naccording to the given formats. When no format is given, uses "l" as a\ndefault. As an example, the construction\n\n for c in file:lines(1) do *body* end\n\nwill iterate over all characters of the file, starting at the current\nposition. Unlike `io.lines`, this function does not close the file when the\nloop ends.
+lines io.lines([filename, ···])\nOpens the given file name in read mode and returns an iterator function that\nworks like `file:lines(···)` over the opened file. When the iterator function\nfails to read any value, it automatically closes the file. Besides the\niterator function, `io.lines` returns three other values: two nil values as\nplaceholders, plus the created file handle. Therefore, when used in a generic\nfor loop, the file is closed also if the loop is interrupted by an error or a\n`break`.\n\nThe call `io.lines()` (with no file name) is equivalent to\n`io.input():lines("l")`; that is, it iterates over the lines of the default\ninput file. In this case it does not close the file when the loop ends.\n\nIn case of errors opening the file, this function raises the error, instead\nof returning an error code.
link lfs.link(old, new[, symlink])\nCreates a link. The first argument is the object to link to and the second is\nthe name of the link. If the optional third argument is true, the link will\nbe a symbolic link (by default, a hard link is created).
-load _G.load(chunk [, chunkname [, mode [, env]]])\nLoads a chunk.\n\nIf `chunk` is a string, the chunk is this string. If `chunk` is a function, `load`\ncalls it repeatedly to get the chunk pieces. Each call to `chunk` must return a\nstring that concatenates with previous results. A return of an empty string,\nnil, or no value signals the end of the chunk.\n\nIf there are no syntactic errors, returns the compiled chunk as a function;\notherwise, returns nil plus the error message.\n\nIf the resulting function has upvalues, the first upvalue is set to the value\nof `env`, if that parameter is given, or to the value of the global\nenvironment. Other upvalues are initialized with nil. (When you load a main\nchunk, the resulting function will always have exactly one upvalue, the\n`_ENV` variable (see §2.2). However, when you load a binary chunk created\nfrom a function (see `string.dump`), the resulting function can have an\narbitrary number of upvalues.) All upvalues are fresh, that is, they are not\nshared with any other function.\n\n`chunkname` is used as the name of the chunk for error messages and debug\ninformation (see §4.9). When absent, it defaults to `chunk`, if `chunk` is a\nstring, or to "`=(load)`" otherwise.\n\nThe string `mode` controls whether the chunk can be text or binary (that is,\na precompiled chunk). It may be the string "`b`" (only binary chunks), "`t`"\n(only text chunks), or "`bt`" (both binary and text). The default is "`bt`".\n\nLua does not check the consistency of binary chunks. Maliciously crafted\nbinary chunks can crash the interpreter.
+load _G.load(chunk [, chunkname [, mode [, env]]])\nLoads a chunk.\n\nIf `chunk` is a string, the chunk is this string. If `chunk` is a function,\n`load` calls it repeatedly to get the chunk pieces. Each call to `chunk` must\nreturn a string that concatenates with previous results. A return of an empty\nstring, nil, or no value signals the end of the chunk.\n\nIf there are no syntactic errors, `load` returns the compiled chunk as a\nfunction; otherwise, it returns nil plus the error message.\n\nWhen you load a main chunk, the resulting function will always have exactly\none upvalue, the `_ENV` variable (see §2.2). However, when you load a binary\nchunk created from a function (see `string.dump`), the resulting function can\nhave an arbitrary number of upvalues, and there is no guarantee that its\nfirst upvalue will be the `_ENV` variable. (A non-main function may not even\nhave an `_ENV` upvalue.)\n\nRegardless, if the resulting function has any upvalues, its first upvalue is\nset to the value of `env`, if that parameter is given, or to the value of the\nglobal environment. Other upvalues are initialized with nil. All upvalues are\nfresh, that is, they are not shared with any other function.\n\n`chunkname` is used as the name of the chunk for error messages and debug\ninformation (see §4.7). When absent, it defaults to `chunk`, if `chunk` is a\nstring, or to "`=(load)`" otherwise.\n\nThe string `mode` controls whether the chunk can be text or binary (that is,\na precompiled chunk). It may be the string "`b`" (only binary chunks), "`t`"\n(only text chunks), or "`bt`" (both binary and text). The default is "`bt`".\n\nIt is safe to load malformed binary chunks; `load` signals an appropriate\nerror. However, Lua does not check the consistency of the code inside binary\nchunks; running maliciously crafted bytecode can crash the interpreter.
loaded package.loaded (table)\nA table used by `require` to control which modules are already loaded. When\nyou require a module `modname` and `package.loaded[modname]` is not false,\n`require` simply returns the value stored there.\nThis variable is only a reference to the real table; assignments to this\nvariable do not change the table used by `require`.
loaders package.loaders (table)\nSee `package.searchers`.\n\nDeprecated in Lua 5.2.
loadfile _G.loadfile([filename [, mode [, env]]])\nSimilar to `load`, but gets the chunk from file `filename` or from the\nstandard input, if no file name is given.
-loadlib package.loadlib(libname, funcname)\nDynamically links the host program with the C library `libname`.\n\nIf `funcname` is "`*`", then it only links with the library, making the\nsymbols exported by the library available to other dynamically linked\nlibraries. Otherwise, it looks for a function `funcname` inside the library\nand returns this function as a C function. So, `funcname` must follow the\n`lua_CFunction` prototype (see `lua_CFunction`).\n\nThis is a low-level function. It completely bypasses the package and module\nsystem. Unlike `require`, it does not perform any path searching and does\nnot automatically adds extensions. `libname` must be the complete file name\nof the C library, including if necessary a path and an extension. `funcname`\nmust be the exact name exported by the C library (which may depend on the\nC compiler and linker used).\n\nThis function is not supported by Standard C. As such, it is only available\non some platforms (Windows, Linux, Mac OS X, Solaris, BSD, plus other Unix\nsystems that support the `dlfcn` standard).
+loadlib package.loadlib(libname, funcname)\nDynamically links the host program with the C library `libname`.\n\nIf `funcname` is "`*`", then it only links with the library, making the\nsymbols exported by the library available to other dynamically linked\nlibraries. Otherwise, it looks for a function `funcname` inside the library\nand returns this function as a C function. So, `funcname` must follow the\n`lua_CFunction` prototype (see `lua_CFunction`).\n\nThis is a low-level function. It completely bypasses the package and module\nsystem. Unlike `require`, it does not perform any path searching and does\nnot automatically adds extensions. `libname` must be the complete file name\nof the C library, including if necessary a path and an extension. `funcname`\nmust be the exact name exported by the C library (which may depend on the\nC compiler and linker used).\n\nThis function is not supported by Standard C. As such, it is only available\non some platforms (Windows, Linux, Mac OS X, Solaris, BSD, plus other Unix\nsystems that support the `dlfcn` standard).\n\nThis function is inherently insecure, as it allows Lua to call any function\nin any readable dynamic library in the system. (Lua calls any function\nassuming the function has a proper prototype and respects a proper protocol\n(see lua_CFunction). Therefore, calling an arbitrary function in an arbitrary\ndynamic library more often than not results in an access violation.)
loadstring _G.loadstring(string [, chunkname])\nSimilar to `load`, but gets the chunk from the given string. To load and\nrun a given string, use the idiom assert(loadstring(s))() When absent,\n`chunkname` defaults to the given string.\n\nDeprecated in Lua 5.2.
locale lpeg.locale([table])\nReturns a table with patterns for matching some character classes according\nto the current locale. The table has fields named `alnum`, `alpha`, `cntrl`,\n`digit`, `graph`, `lower`, `print`, `punct`, `space`, `upper`, and `xdigit`,\neach one containing a correspondent pattern. Each pattern matches any single\ncharacter that belongs to its class.\n\nIf called with an argument `table`, then it creates those fields inside the\ngiven table and returns that table.
lock lfs.lock(filehandle, mode[, start[, length]])\nLocks a file or a part of it. This function works on open files; the file\nhandle should be specified as the first argument. The string mode could be\neither r (for a read/shared lock) or w (for a write/exclusive lock). The\noptional arguments start and length can be used to specify a starting point\nand its length; both should be numbers.\n\nReturns true if the operation was successful; in case of error, it returns\nnil plus an error string.
@@ -111,77 +112,77 @@ lpeg _G.lpeg (module)\nLua lpeg module.
lrotate bit32.lrotate(x, disp)\nReturns the number `x` rotated `disp` bits to the left. The number `disp` may\nbe any representable integer.\n\nFor any valid displacement, the following identity holds:\n\n assert(bit32.lrotate(x, disp) == bit32.lrotate(x, disp % 32))\n\nIn particular, negative displacements rotate to the right.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
lshift bit32.lshift(x, disp)\nReturns the number `x` shifted `disp` bits to the left. The number `disp` may\nbe any representable integer. Negative displacements shift to the right. In\nany direction, vacant bits are filled with zeros. In particular,\ndisplacements with absolute values higher than 31 result in zero (all bits\nare shifted out).\n\nFor positive displacements, the following equality holds:\n\n assert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32)\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
match lpeg.match(pattern, subject [, init])\nThe matching function. It attempts to match the given pattern against the\nsubject string. If the match succeeds, returns the index in the subject of\nthe first character after the match, or the captured values (if the pattern\ncaptured any value).\n\nAn optional numeric argument `init` makes the match start at that position in\nthe subject string. As usual in Lua libraries, a negative value counts from\nthe end.\n\nUnlike typical pattern-matching functions, match works only in anchored mode;\nthat is, it tries to match the pattern with a prefix of the given subject\nstring (at position `init`), not with an arbitrary substring of the subject.\nSo, if we want to find a pattern anywhere in a string, we must either write a\nloop in Lua or write a pattern that matches anywhere. This second approach is\neasy and quite efficient; see examples.
-match string.match(s, pattern [, init])\nLooks for the first *match* of `pattern` (see §6.4.1) in the string `s`. If\nit finds one, then `match` returns the captures from the pattern; otherwise\nit returns nil. If `pattern` specifies no captures, then the whole match\nis returned. A third, optional numerical argument `init` specifies where\nto start the search; its default value is 1 and can be negative.
+match string.match(s, pattern [, init])\nLooks for the first *match* of the `pattern` (see §6.4.1) in the string `s`.\nIf it finds one, then `match` returns the captures from the pattern;\notherwise it returns nil. If `pattern` specifies no captures, then the whole\nmatch is returned. A third, optional numerical argument `init` specifies\nwhere to start the search; its default value is 1 and can be negative.
math _G.math (module)\nLua math module.
-max math.max(x, ···)\nReturns the argument with the maximum value, according to the Lua operator\n`<`. (integer/float)
+max math.max(x, ···)\nReturns the argument with the maximum value, according to the Lua operator\n`<`.
maxinteger math.maxinteger (number)\nAn integer with the maximum value for an integer.\n\nNew in Lua 5.3.
maxn table.maxn(table)\nReturns the largest positive numerical index of the given table, or zero if\nthe table has no positive numerical indices. (To do its job this function\ndoes a linear traversal of the whole table.)\n\nDeprecated in Lua 5.2.
-min math.min(x, ···)\nReturns the argument with the minimum value, according to the Lua operator\n`<`. (integer/float)
+min math.min(x, ···)\nReturns the argument with the minimum value, according to the Lua operator\n`<`.
mininteger math.mininteger (number)\nAn integer with the minimum value for an integer.\n\nNew in Lua 5.3.
mkdir lfs.mkdir(dirname)\nCreates a new directory. The argument is the name of the new directory.\n\nReturns true in case of success or nil, an error message and a\nsystem-dependent error code in case of error.
modf math.modf(x)\nReturns the integral part of `x` and the fractional part of `x`. Its second\nresult is always a float.
module _G.module(name [, ···])\nCreates a module. If there is a table in `package.loaded[name]`, this table\nis the module. Otherwise, if there is a global table `t` with the given name,\nthis table is the module. Otherwise creates a new table `t` and sets it as\nthe value of the global `name` and the value of `package.loaded[name]`. This\nfunction also initializes `t._NAME` with the given name, `t._M` with the\nmodule (`t` itself), and `t._PACKAGE` with the package name (the full module\nname minus last component; see below). Finally, `module` sets `t` as the new\nenvironment of the current function and the new value of\n`package.loaded[name]`, so that `require` returns `t`. If `name` is a\ncompound name (that is, one with components separated by dots), `module`\ncreates (or reuses, if they already exist) tables for each component. For\ninstance, if `name` is `a.b.c`, then `module` stores the module table in\nfield `c` of field `b` of global `a`. This function can receive optional\n*options* after the module name, where each option is a function to be\napplied over the module.\n\nDeprecated in Lua 5.2.
-move table.move(a1, f, e, t [, a2])\nMoves elements from table `a1` to table `a2`, performing the equivalent to\nthe following multiple assignment: `a2[t], ··· = a1[f], ···, a1[e]`. The\ndefault for `a2` is `a1`. The destination range can overlap with the source\nrange. Index `f` must be positive.\n\nReturns the destination table `a2`.\n\nNew in Lua 5.3.
-next _G.next(table [, index])\nAllows a program to traverse all fields of a table. Its first argument is\na table and its second argument is an index in this table. `next` returns\nthe next index of the table and its associated value. When called with nil\nas its second argument, `next` returns an initial index and its associated\nvalue. When called with the last index, or with nil in an empty table, `next`\nreturns nil. If the second argument is absent, then it is interpreted as\nnil. In particular, you can use `next(t)` to check whether a table is empty.\n\nThe order in which the indices are enumerated is not specified, *even for\nnumeric indices*. (To traverse a table in numeric order, use a numerical\n`for`.)\n\nThe behavior of `next` is undefined if, during the traversal, you assign any\nvalue to a non-existent field in the table. You may however modify existing\nfields. In particular, you may clear existing fields.
+move table.move(a1, f, e, t [, a2])\nMoves elements from the table `a1` to the table `a2`, performing the\nequivalent to the following multiple assignment: `a2[t], ··· = a1[f], ···,\na1[e]`. The default for `a2` is `a1`. The destination range can overlap with\nthe source range. Index `f` must be positive.\n\nReturns the destination table `a2`.\n\nNew in Lua 5.3.
+next _G.next(table [, index])\nAllows a program to traverse all fields of a table. Its first argument is\na table and its second argument is an index in this table. A call to `next`\nreturns the next index of the table and its associated value. When called\nwith nil as its second argument, `next` returns an initial index and its\nassociated value. When called with the last index, or with nil in an empty\ntable, `next` returns nil. If the second argument is absent, then it is\ninterpreted as nil. In particular, you can use `next(t)` to check whether a\ntable is empty.\n\nThe order in which the indices are enumerated is not specified, *even for\nnumeric indices*. (To traverse a table in numeric order, use a numerical\n`for`.)\n\nThe behavior of `next` is undefined if, during the traversal, you assign any\nvalue to a non-existent field in the table. You may however modify existing\nfields. In particular, you may set existing fields to nil.
offset utf8.offset(s, n [, i])\nReturns the position (in bytes) where the encoding of the `n`-th character of\n`s` (counting from position `i`) starts. A negative `n` gets characters\nbefore position `i`. The default for `i` is 1 when `n` is non-negative and\n`#s + 1` otherwise, so that `utf8.offset(s, -n)` gets the offset of the\n`n`-th character from the end of the string. If the specified character is\nneither in the subject nor right after its end, the function returns nil.\n\nAs a special case, when `n` is 0 the function returns the start of the\nencoding of the character that contains the `i`-th byte of `s`.\n\nThis function assumes that `s` is a valid UTF-8 string.\n\nNew in Lua 5.3.
open io.open(filename [, mode])\nThis function opens a file, in the mode specified in the string `mode`. It\nreturns a new file handle, or, in case of errors, nil plus an error message.\n\nThe `mode` string can be any of the following:\n "r": read mode (the default);\n "w": write mode;\n "a": append mode;\n "r+": update mode, all previous data is preserved;\n "w+": update mode, all previous data is erased;\n "a+": append update mode, previous data is preserved, writing is only\n allowed at the end of file.\n\nThe `mode` string can also have a '`b`' at the end, which is needed in\nsome systems to open the file in binary mode.
os _G.os (module)\nLua os module.
output io.output([file])\nSimilar to `io.input`, but operates over the default output file.
-pack string.pack(fmt, v1, v2, ···)\nReturns a binary string containing the values `v1`, `v2`, etc. packed (that\nis, serialized in binary form) according to the format string `fmt` (see\n§6.4.2).\n\nNew in Lua 5.3.
-pack table.pack(···)\nReturns a new table with all parameters stored into keys 1, 2, etc. and with\na field "`n`" with the total number of parameters. Note that the resulting\ntable may not be a sequence.\n\nNew in Lua 5.2.
+pack string.pack(fmt, v1, v2, ···)\nReturns a binary string containing the values `v1`, `v2`, etc. serialized in\nbinary form (packed) according to the format string `fmt` (see §6.4.2).\n\nNew in Lua 5.3.
+pack table.pack(···)\nReturns a new table with all parameters stored into keys 1, 2, etc. and with\na field "`n`" with the total number of parameters. Note that the resulting\ntable may not be a sequence, if some arguments are nil.\n\nNew in Lua 5.2.
package _G.package (module)\nLua package module.
packsize string.packsize(fmt)\nReturns the size of a string resulting from `string.pack` with the given\nformat. The format string cannot have the variable-length options 's' or 'z'\n(see §6.4.2).\n\nNew in Lua 5.3.
pairs _G.pairs(t)\nIf `t` has a metamethod `__pairs`, calls it with `t` as argument and returns\nthe first three results from the call.\n\nOtherwise, returns three values: the `next` function, the table `t`, and nil,\nso that the construction\n\n for k,v in pairs(t) do *body* end\n\nwill iterate over all key–value pairs of table `t`.\n\nSee function `next` for the caveats of modifying the table during its\ntraversal.
-path package.path (string)\nThe path used by `require` to search for a Lua loader.\nAt start-up, Lua initializes this variable with the value of the\nenvironment variable `LUA_PATH_5_3` or the environment variable `LUA_PATH`\nor with a default path defined in `luaconf.h`, if those environment\nvariables are not defined. Any "`;;`" in the value of the environment\nvariable is replaced by the default path.
-pcall _G.pcall(f [, arg1, ···])\nCalls function `f` with the given arguments in *protected mode*. This\nmeans that any error inside `f` is not propagated; instead, `pcall` catches\nthe error and returns a status code. Its first result is the status code (a\nboolean), which is true if the call succeeds without errors. In such case,\n`pcall` also returns all results from the call, after this first result. In\ncase of any error, `pcall` returns false plus the error message.
+path package.path (string)\nA string with the path used by `require` to search for a Lua loader.\nAt start-up, Lua initializes this variable with the value of the\nenvironment variable `LUA_PATH_5_4` or the environment variable `LUA_PATH`\nor with a default path defined in `luaconf.h`, if those environment\nvariables are not defined. A "`;;`" in the value of the environment\nvariable is replaced by the default path.
+pcall _G.pcall(f [, arg1, ···])\nCalls the function `f` with the given arguments in *protected mode*. This\nmeans that any error inside `f` is not propagated; instead, `pcall` catches\nthe error and returns a status code. Its first result is the status code (a\nboolean), which is true if the call succeeds without errors. In such case,\n`pcall` also returns all results from the call, after this first result. In\ncase of any error, `pcall` returns false plus the error object. Note that\nerrors caught by `pcall` do not call a message handler.
pi math.pi (number)\nThe value of 'π'.
-popen io.popen(prog [, mode])\nStarts program `prog` in a separated process and returns a file handle\nthat you can use to read data from this program (if `mode` is `"r"`,\nthe default) or to write data to this program (if `mode` is `"w"`).\n\nThis function is system dependent and is not available on all platforms.
+popen io.popen(prog [, mode])\nStarts the program `prog` in a separated process and returns a file handle\nthat you can use to read data from this program (if `mode` is `"r"`,\nthe default) or to write data to this program (if `mode` is `"w"`).\n\nThis function is system dependent and is not available on all platforms.
pow math.pow(x, y)\nReturns *x^y*. (You can also use the expression `x^y` to compute this\nvalue.)\n\nDeprecated in Lua 5.3.
preload package.preload (table)\nA table to store loaders for specific modules (see `require`).\nThis variable is only a reference to the real table; assignments to this\nvariable do not change the table used by `require`.
-print _G.print(···)\nReceives any number of arguments and prints their values to `stdout`, using\nthe `tostring` function to convert each argument to a string. `print` is not\nintended for formatted output, but only as a quick way to show a value,\nfor instance for debugging. For complete control over the output, use\n`string.format` and `io.write`.
+print _G.print(···)\nReceives any number of arguments and prints their values to `stdout`,\nconverting each argument to a string following the same rules of `tostring`.\n\nThe function `print` is not intended for formatted output, but only as a\nquick way to show a value, for instance for debugging. For complete control\nover the output, use `string.format` and `io.write`.
rad math.rad(x)\nConverts the angle `x` from degrees to radians.
-random math.random([m [, n]])\nWhen called without arguments, returns a pseudo-random float with uniform\ndistribution in the range [0,1). When called with two integers `m` and `n`,\n`math.random` returns a pseudo-random integer with uniform distribution in\nthe range `[m, n]. (The value `n-m` cannot be negative and must fit in a Lua\ninteger.) The call `math.random(n)` is equivalent to `math.random(1, n)`.\n\nThis function is an interface to the underling pseudo-random generator\nfunction provided by C.
-randomseed math.randomseed(x)\nSets `x` as the "seed" for the pseudo-random generator: equal seeds\nproduce equal sequences of numbers.
+random math.random([m [, n]])\nWhen called without arguments, returns a pseudo-random float with uniform\ndistribution in the range [0,1). When called with two integers `m` and `n`,\n`math.random` returns a pseudo-random integer with uniform distribution in\nthe range `[m, n]. The call `math.random(n)`, for a positive `n`, is\nequivalent to `math.random(1,n)`. The call `math.random(0)` produces an\ninteger with all bits (pseudo)random.\n\nThis function uses the `xoshiro256**` algorithm to produce pseudo-random\n64-bit integers, which are the results of calls with argument 0. Other\nresults (ranges and floats) are unbiased extracted from these integers.\n\nLua initializes its pseudo-random generator with the equivalent of a call to\n`math.randomseed` with no arguments, so that `math.random` should generate\ndifferent sequences of results each time the program runs.
+randomseed math.randomseed([x [, y]])\nWhen called with at least one argument, the integer parameters `x` and `y`\nare joined into a 128-bit *seed* that is used to reinitialize the\npseudo-random generator; equal seeds produce equal sequences of numbers. The\ndefault for `y` is zero.\n\nWhen called with no arguments, Lua generates a seed with a weak attempt for\nrandomness.\n\nThis function returns the two seed components that were effectively used, so\nthat setting them again repeats the sequence.\n\nTo ensure a required level of randomness to the initial state (or contrarily,\nto have a deterministic sequence, for instance when debugging a program), you\nshould call `math.randomseed` with explicit arguments.
rawequal _G.rawequal(v1, v2)\nChecks whether `v1` is equal to `v2`, without invoking the `__eq`\nmetamethod. Returns a boolean.
-rawget _G.rawget(table, index)\nGets the real value of `table[index]`, without invoking the `__index`\nmetamethod. `table` must be a table; `index` may be any value.
+rawget _G.rawget(table, index)\nGets the real value of `table[index]`, without using the `__index`\nmetavalue. `table` must be a table; `index` may be any value.
rawlen _G.rawlen(v)\nReturns the length of the object `v`,\nwhich must be a table or a string,\nwithout invoking the `__len` metamethod.\nReturns an integer.\n\nNew in Lua 5.2.
-rawset _G.rawset(table, index, value)\nSets the real value of `table[index]` to `value`, without invoking the\n`__newindex` metamethod. `table` must be a table, `index` any value different\nfrom nil and NaN, and `value` any Lua value.\n\nThis function returns `table`.
-read file:read(···)\nReads the file `file`, according to the given formats, which specify\nwhat to read. For each format, the function returns a string or a number\nwith the characters read, or nil if it cannot read data with the specified\nformat. (In this latter case, the function does not read subsequent formats.)\nWhen called without formats, it uses a default format that reads the next\nline (see below).\n\nThe available formats are\n "n": reads a numeral and returns it as a float or an integer, following the\n lexical conventions of Lua. (The numeral may have leading spaces and a\n sign.) This format always reads the longest input sequence that is a\n valid prefix for a number; if that prefix does not form a valid number\n (e.g., an empty string, "0x", or "3.4e-"), it is discarded and the\n function returns nil.\n "a": reads the whole file, starting at the current position. On end of\n file, it returns the empty string.\n "l": reads the next line skipping the end of line, returning nil on\n end of file. This is the default format.\n "L": reads the next line keeping the end-of-line character (if present),\n returning nil on end of file.\n *number*: reads a string with up to this number of bytes, returning nil on\n end of file. If *number* is zero, it reads nothing and returns an\n empty string, or nil on end of file.\n\nThe formats "l" and "L" should be used only for text files.
+rawset _G.rawset(table, index, value)\nSets the real value of `table[index]` to `value`, without using the\n`__newindex` metavalue. `table` must be a table, `index` any value different\nfrom nil and NaN, and `value` any Lua value.\n\nThis function returns `table`.
+read file:read(···)\nReads the file `file`, according to the given formats, which specify\nwhat to read. For each format, the function returns a string or a number\nwith the characters read, or nil if it cannot read data with the specified\nformat. (In this latter case, the function does not read subsequent formats.)\nWhen called without arguments, it uses a default format that reads the next\nline (see below).\n\nThe available formats are\n "n": reads a numeral and returns it as a float or an integer, following the\n lexical conventions of Lua. (The numeral may have leading whitespaces\n and a sign.) This format always reads the longest input sequence that\n is a valid prefix for a number; if that prefix does not form a valid\n number (e.g., an empty string, "0x", or "3.4e-") or it is too long\n (more than 200 characters), it is discarded and the format returns\n nil.\n "a": reads the whole file, starting at the current position. On end of\n file, it returns the empty string; this format never fails.\n "l": reads the next line skipping the end of line, returning nil on\n end of file. This is the default format.\n "L": reads the next line keeping the end-of-line character (if present),\n returning nil on end of file.\n *number*: reads a string with up to this number of bytes, returning nil on\n end of file. If *number* is zero, it reads nothing and returns an\n empty string, or nil on end of file.\n\nThe formats "l" and "L" should be used only for text files.
read io.read(···)\nEquivalent to `io.input():read(···)`.
remove os.remove(filename)\nDeletes the file (or empty directory, on POSIX systems) with the given name.\nIf this function fails, it returns nil, plus a string describing the error\nand the error code.
-remove table.remove(list [, pos])\nRemoves from `list` the element at position `pos`, returning the value of the\nremoved element. When `pos` is an integer between 1 and `#list`, it shifts\ndown the elements `list[pos+1], list[pos+2], ···, list[#list]` and erases\nelement `list[#list]`; The index `pos` can also be 0 when `#list` is 0, or\n`#list + 1`; in those cases, the function erases the element `list[pos]`.\n\nThe default value for `pos` is `#list`, so that a call `table.remove(l)`\nremoves the last element of list `l`.
+remove table.remove(list [, pos])\nRemoves from `list` the element at position `pos`, returning the value of the\nremoved element. When `pos` is an integer between 1 and `#list`, it shifts\ndown the elements `list[pos+1], list[pos+2], ···, list[#list]` and erases\nelement `list[#list]`; The index `pos` can also be 0 when `#list` is 0, or\n`#list + 1`.\n\nThe default value for `pos` is `#list`, so that a call `table.remove(l)`\nremoves the last element of the list `l`.
rename os.rename(oldname, newname)\nRenames file or directory named `oldname` to `newname`. If this function\nfails, it returns nil, plus a string describing the error and the error code.
rep string.rep(s, n [, sep])\nReturns a string that is the concatenation of `n` copies of the string `s`\nseparated by the string `sep`. The default value for `sep` is the empty\nstring (that is, no separator). Returns the empty string if `n` is not\npositive.\n\n(Note that it is very easy to exhaust the memory of your machine with a\nsingle call to this function.)
replace bit32.replace(n, v, field [, width])\nReturns a copy of `n` with the bits `field` to `field + width - 1` replaced\nby the value `v`. See `bit32.extract` for details about `field` and `width`.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
-require _G.require(modname)\nLoads the given module. The function starts by looking into the\n`package.loaded` table to determine whether `modname` is already\nloaded. If it is, then `require` returns the value stored at\n`package.loaded[modname]`. Otherwise, it tries to find a *loader* for\nthe module.\n\nTo find a loader, `require` is guided by the `package.searchers` sequence. By\nchanging this sequence, we can change how `require` looks for a module. The\nfollowing explanation is based on the default configuration for\n`package.searchers`.\n\nFirst `require` queries `package.preload[modname]`. If it has a value,\nthis value (which must be a function) is the loader. Otherwise `require`\nsearches for a Lua loader using the path stored in `package.path`. If\nthat also fails, it searches for a C loader using the path stored in\n`package.cpath`. If that also fails, it tries an *all-in-one* loader (see\n`package.searchers`).\n\nOnce a loader is found, `require` calls the loader with two arguments:\n`modname` and an extra value dependent on how it got the loader. (If the\nloader came from a file, this extra value is the file name.) If the loader\nreturns any non-nil value, `require` assigns the returned value to\n`package.loaded[modname]`. If the loader does not return a non-nil value and\nhas not assigned any value to `package.loaded[modname]`, then `require`\nassigns true to this entry. In any case, `require` returns the final value of\n`package.loaded[modname]`.\n\nIf there is any error loading or running the module, or if it cannot find\nany loader for the module, then `require` raises an error.
+require _G.require(modname)\nLoads the given module. The function starts by looking into the\n`package.loaded` table to determine whether `modname` is already loaded. If\nit is, then `require` returns the value stored at `package.loaded[modname]`.\n(The absence of a second result in this case signals that this call did not\nhave to load the module.) Otherwise, it tries to find a *loader* for the\nmodule.\n\nTo find a loader, `require` is guided by the table `package.searchers`. Each\nitem in this table is a search function, that searches for the module in a\nparticular way. By changing this table, we can change how `require` looks for\na module. The following explanation is based on the default configuration for\n`package.searchers`.\n\nFirst `require` queries `package.preload[modname]`. If it has a value,\nthis value (which must be a function) is the loader. Otherwise `require`\nsearches for a Lua loader using the path stored in `package.path`. If\nthat also fails, it searches for a C loader using the path stored in\n`package.cpath`. If that also fails, it tries an *all-in-one* loader (see\n`package.searchers`).\n\nOnce a loader is found, `require` calls the loader with two arguments:\n`modname` and an extra value, a *loader data*, also returned by the searcher.\nThe loader data can be any value useful to the module; for the default\nsearchers, it indicates where the loader was found. (For instance, if the\nloader came from a file, this extra value is the file path.) If the loader\nreturns any non-nil value, `require` assigns the returned value to\n`package.loaded[modname]`. If the loader does not return a non-nil value and\nhas not assigned any value to `package.loaded[modname]`, then `require`\nassigns true to this entry. In any case, `require` returns the final value of\n`package.loaded[modname]`. Besides that value, `require` also returns as a\nsecond result the loader data returned by the searcher, which indicates how\n`require` found the module.\n\nIf there is any error loading or running the module, or if it cannot find\nany loader for the module, then `require` raises an error.
resume coroutine.resume(co [, val1, ···])\nStarts or continues the execution of coroutine `co`. The first time\nyou resume a coroutine, it starts running its body. The values `val1`,\n··· are passed as the arguments to the body function. If the coroutine\nhas yielded, `resume` restarts it; the values `val1`, ··· are passed\nas the results from the yield.\n\nIf the coroutine runs without any errors, `resume` returns true plus any\nvalues passed to `yield` (when the coroutine yields) or any values returned\nby the body function (when the coroutine terminates). If there is any error,\n`resume` returns false plus the error message.
reverse string.reverse(s)\nReturns a string that is the string `s` reversed.
rmdir lfs.rmdir(dirname)\nRemoves an existing directory. The argument is the name of the directory.\n\nReturns true in case of success or nil, an error message and a\nsystem-dependent error code in case of error.
rrotate bit32.rrotate(x, disp)\nReturns the number `x` rotated `disp` bits to the right. The number `disp`\nmay be any representable integer.\n\nFor any valid displacement, the following identity holds:\n\n assert(bit32.rrotate(x, disp) == bit32.rrotate(x, disp % 32))\n\nIn particular, negative displacements rotate to the left.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
rshift bit32.rshift(x, disp)\nReturns the number `x` shifted `disp` bits to the right. The number `disp`\nmay be any representable integer. Negative displacements shift to the left.\nIn any direction, vacant bits are filled with zeros. In particular,\ndisplacements with absolute values higher than 31 result in zero (all bits\nare shifted out).\n\nFor positive displacements, the following equality holds:\n\n assert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp))\n\nThis shift operation is what is called logical shift.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
running coroutine.running()\nReturns the running coroutine plus a boolean, true when the running coroutine\nis the main one.
-searchers package.searchers (table)\nA table used by `require` to control how to load modules.\nEach entry in this table is a *searcher function*. When looking for a\nmodule, `require` calls each of these searchers in ascending order, with\nthe module name (the argument given to `require`) as its sole parameter.\nThe function can return another function (the module *loader*) plus an\nextra value that will be passed to that loader, or a string explaining why\nit did not find that module (or nil if it has nothing to say).\nLua initializes this table with four functions.\nThe first searcher simply looks for a loader in the `package.preload`\ntable.\nThe second searcher looks for a loader as a Lua library, using the path\nstored at `package.path`. The search is done as described in function\n`package.searchpath`.\nThe third searcher looks for a loader as a C library, using the path given\nby the variable `package.cpath`. Again, the search is done as described in\nfunction `package.searchpath`. For instance, if the C path is the string\n "./?.so;./?.dll;/usr/local/?/init.so"\nthe searcher for module `foo` will try to open the files `./foo.so`,\n`./foo.dll`, and `/usr/local/foo/init.so`, in that order. Once it finds\na C library, this searcher first uses a dynamic link facility to link the\napplication with the library. Then it tries to find a C function inside the\nlibrary to be used as the loader. The name of this C function is the string\n"`luaopen_`" concatenated with a copy of the module name where each dot\nis replaced by an underscore. Moreover, if the module name has a hyphen,\nits suffix after (and including) the first hyphen is removed. For instance,\nif the module name is `a.b.c-v2.1 `, the function name will be\n`luaopen_a_b_c`. The fourth searcher tries an *all-in-one loader*. It\nsearches the C path for a library for the root name of the given module.\nFor instance, when requiring `a.b.c`, it will search for a C library for\n`a`. If found, it looks into it for an open function for the submodule; in\nour example, that would be `luaopen_a_b_c`. With this facility, a package\ncan pack several C submodules into one single library, with each submodule\nkeeping its original open function.\nAll searchers except the first one (preload) return as the extra value the\nfile name where the module was found, as returned by `package.searchpath`.\nThe first searcher returns no extra value.\n\nNew in Lua 5.2.
+searchers package.searchers (table)\nA table used by `require` to control how to find modules.\nEach entry in this table is a *searcher function*. When looking for a\nmodule, `require` calls each of these searchers in ascending order, with\nthe module name (the argument given to `require`) as its sole argument.\nIf the searcher finds the module, it returns another function, the module\n*loader*, plus an extra value, a *loader data*, that will be passed to that\nloader and returned as a second result by `require`. If it cannot find the\nmodule, it returns a string explaining why (or nil if it has nothing to\nsay).\nLua initializes this table with four functions.\nThe first searcher simply looks for a loader in the `package.preload`\ntable.\nThe second searcher looks for a loader as a Lua library, using the path\nstored at `package.path`. The search is done as described in function\n`package.searchpath`.\nThe third searcher looks for a loader as a C library, using the path given\nby the variable `package.cpath`. Again, the search is done as described in\nfunction `package.searchpath`. For instance, if the C path is the string\n "./?.so;./?.dll;/usr/local/?/init.so"\nthe searcher for module `foo` will try to open the files `./foo.so`,\n`./foo.dll`, and `/usr/local/foo/init.so`, in that order. Once it finds\na C library, this searcher first uses a dynamic link facility to link the\napplication with the library. Then it tries to find a C function inside the\nlibrary to be used as the loader. The name of this C function is the string\n"`luaopen_`" concatenated with a copy of the module name where each dot\nis replaced by an underscore. Moreover, if the module name has a hyphen,\nits suffix after (and including) the first hyphen is removed. For instance,\nif the module name is `a.b.c-v2.1 `, the function name will be\n`luaopen_a_b_c`. The fourth searcher tries an *all-in-one loader*. It\nsearches the C path for a library for the root name of the given module.\nFor instance, when requiring `a.b.c`, it will search for a C library for\n`a`. If found, it looks into it for an open function for the submodule; in\nour example, that would be `luaopen_a_b_c`. With this facility, a package\ncan pack several C submodules into one single library, with each submodule\nkeeping its original open function.\nAll searchers except the first one (preload) return as the extra value the\nfile path where the module was found, as returned by `package.searchpath`.\nThe first searcher always returns the string "`:preload:`".\nSearchers should raise no errors and have no side effects in Lua. (They may\nhave side effects in C, for instance by linking the application with a\nlibrary.)\n\nNew in Lua 5.2.
searchpath package.searchpath(name, path [, sep [, rep]])\nSearches for the given `name` in the given `path`.\n\nA path is a string containing a sequence of _templates_ separated by\nsemicolons. For each template, the function replaces each interrogation mark\n(if any) in the template with a copy of `name` wherein all occurrences of\n`sep` (a dot, by default) were replaced by `rep` (the system's directory\nseparator, by default), and then tries to open the resulting file name.\nFor instance, if the path is the string\n "./?.lua;./?.lc;/usr/local/?/init.lua"\nthe search for the name `foo.a` will try to open the files `./foo/a.lua`,\n`./foo/a.lc`, and `/usr/local/foo/a/init.lua`, in that order.\nReturns the resulting name of the first file that it can open in read mode\n(after closing the file), or nil plus an error message if none succeeds.\n(This error message lists all file names it tried to open.)\n\nNew in Lua 5.2.
seeall package.seeall(module)\nSets a metatable for `module` with its `__index` field referring to the\nglobal environment, so that this module inherits values from the global\nenvironment. To be used as an option to function `module`.\n\nDeprecated in Lua 5.2.
seek file:seek([whence [, offset]])\nSets and gets the file position, measured from the beginning of the\nfile, to the position given by `offset` plus a base specified by the string\n`whence`, as follows:\n "set": base is position 0 (beginning of the file);\n "cur": base is current position;\n "end": base is end of file;\n\nIn case of success, function `seek` returns the final file position,\nmeasured in bytes from the beginning of the file. If `seek` fails, it returns\nnil, plus a string describing the error.\n\nThe default value for `whence` is `"cur"`, and for `offset` is 0. Therefore,\nthe call `file:seek()` returns the current file position, without changing\nit; the call `file:seek("set")` sets the position to the beginning of the\nfile (and returns 0); and the call `file:seek("end")` sets the position\nto the end of the file, and returns its size.
select _G.select(index, ···)\nIf `index` is a number, returns all arguments after argument number\n`index`; a negative number indexes from the end (-1 is the last argument).\nOtherwise, `index` must be the string `"#"`, and `select` returns the total\nnumber of extra arguments it received.
setfenv _G.setfenv(f, table)\nSets the environment to be used by the given function. `f` can be a Lua\nfunction or a number that specifies the function at that stack level: Level 1\nis the function calling `setfenv`. `setfenv` returns the given function. As a\nspecial case, when `f` is 0 `setfenv` changes the environment of the running\nthread. In this case, `setfenv` returns no values.\n\nDeprecated in Lua 5.2.
setfenv debug.setfenv(object, table)\nSets the environment of the given `object` to the given `table`. Returns\n`object`.\n\nDeprecated in Lua 5.2.
-sethook debug.sethook([thread, ] hook, mask [, count])\nSets the given function as a hook. The string `mask` and the number\n`count` describe when the hook will be called. The string mask may have any\ncombination of the following characters, with the given meaning:\n "c": the hook is called every time Lua calls a function;\n "r": the hook is called every time Lua returns from a function;\n "l": the hook is called every time Lua enters a new line of code.\n\nMoreover, with a `count` different from zero, the hook is called also after\nevery `count` instructions.\n\nWhen called without arguments, `debug.sethook` turns off the hook.\n\nWhen the hook is called, its first parameter is a string describing\nthe event that has triggered its call: `"call"` (or `"tail call"`),\n`"return"`, `"line"`, and `"count"`. For line events, the hook also gets the\nnew line number as its second parameter. Inside a hook, you can call\n`getinfo` with level 2 to get more information about the running function\n(level 0 is the `getinfo` function, and level 1 is the hook function).
+sethook debug.sethook([thread, ] hook, mask [, count])\nSets the given function as the debug hook. The string `mask` and the number\n`count` describe when the hook will be called. The string mask may have any\ncombination of the following characters, with the given meaning:\n "c": the hook is called every time Lua calls a function;\n "r": the hook is called every time Lua returns from a function;\n "l": the hook is called every time Lua enters a new line of code.\n\nMoreover, with a `count` different from zero, the hook is called also after\nevery `count` instructions.\n\nWhen called without arguments, `debug.sethook` turns off the hook.\n\nWhen the hook is called, its first parameter is a string describing\nthe event that has triggered its call: `"call"`, `"tail call"`, `"return"`,\n`"line"`, and `"count"`. For line events, the hook also gets the new line\nnumber as its second parameter. Inside a hook, you can call `getinfo` with\nlevel 2 to get more information about the running function. (Level 0 is the\n`getinfo` function, and level 1 is the hook function.)
setlocal debug.setlocal([thread, ] level, local, value)\nThis function assigns the value `value` to the local variable with\nindex `local` of the function at level `level` of the stack. The function\nreturns nil if there is no local variable with the given index, and raises\nan error when called with a `level` out of range. (You can call `getinfo`\nto check whether the level is valid.) Otherwise, it returns the name of\nthe local variable.\n\nSee `debug.getlocal` for more information about variable indices and names.
setlocale os.setlocale(locale [, category])\nSets the current locale of the program. `locale` is a system-dependent string\nspecifying a locale; `category` is an optional string describing which\ncategory to change: `"all"`, `"collate"`, `"ctype"`, `"monetary"`,\n`"numeric"`, or `"time"`; the default category is `"all"`. The function\nreturns the name of the new locale, or nil if the request cannot be honored.\n\nIf `locale` is the empty string, the current locale is set to an\nimplementation-defined native locale. If `locale` is the string "`C`",\nthe current locale is set to the standard C locale.\n\nWhen called with nil as the first argument, this function only returns\nthe name of the current locale for the given category.\n\nThis function may not be thread safe because of its reliance on C function\n`setlocale`.
setmaxstack lpeg.setmaxstack(max)\nSets the maximum size for the backtrack stack used by LPeg to track calls and\nchoices. Most well-written patterns need little backtrack levels and\ntherefore you seldom need to change this maximum; but a few useful patterns\nmay need more space. Before changing this maximum you should try to rewrite\nyour pattern to avoid the need for extra space.
-setmetatable _G.setmetatable(table, metatable)\nSets the metatable for the given table. (To change the metatable of other\ntypes from Lua code, you must use the debug library.) If `metatable` is nil,\nremoves the metatable of the given table. If the original metatable has a\n`__metatable` field, raises an error.\n\nThis function returns `table`.
+setmetatable _G.setmetatable(table, metatable)\nSets the metatable for the given table. If `metatable` is nil, removes the\nmetatable of the given table. If the original metatable has a `__metatable`\nfield, raises an error.\n\nThis function returns `table`.\n\nTo change the metatable of other types from Lua code, you must use the debug\nlibrary (see §6.10).
setmetatable debug.setmetatable(value, table)\nSets the metatable for the given `value` to the given `table` (which\ncan be nil).
setmode lfs.setmode(file, mode)\nSets the writing mode for a file. The mode string can be either "binary" or\n"text". Returns true followed by the previous mode string for the file, or\nnil followed by an error string in case of errors.. On non-Windows platforms,\nwhere the two modes are identical, setting the mode has no effect, and the\nmode is always returned as binary.
-setupvalue debug.setupvalue(f, up, value)\nThis function assigns the value `value` to the upvalue with index `up`\nof the function `f`. The function returns nil if there is no upvalue with the\ngiven index. Otherwise, it returns the name of the upvalue.
-setuservalue debug.setuservalue(udata, value)\nSets the given `value` as the Lua value associated to the given `udata`.\n`udata` must be a full userdata.\n\nReturns `udata`.\n\nNew in Lua 5.2.
-setvbuf file:setvbuf(mode [, size])\nSets the buffering mode for an output file. There are three available\nmodes:\n "no": no buffering; the result of any output operation appears immediately.\n "full": full buffering; output operation is performed only when the\n buffer is full or when you explicitly `flush` the file (see\n `io.flush`).\n "line": line buffering; output is buffered until a newline is output or\n there is any input from some special files (such as a terminal\n device).\n\nFor the last two cases, `size` specifies the size of the buffer, in\nbytes. The default is an appropriate size.
+setupvalue debug.setupvalue(f, up, value)\nThis function assigns the value `value` to the upvalue with index `up`\nof the function `f`. The function returns nil if there is no upvalue with the\ngiven index. Otherwise, it returns the name of the upvalue.\n\nSee `debug.getupvalue` for more information about upvalues.
+setuservalue debug.setuservalue(udata, value, n)\nSets the given `value` as the `n`-th user value associated to the given\n`udata`. `udata` must be a full userdata.\n\nReturns `udata`, or nil if the userdata does not have that value.\n\nNew in Lua 5.2.
+setvbuf file:setvbuf(mode [, size])\nSets the buffering mode for a file. There are three available modes:\n "no": no buffering\n "full": full buffering\n "line": line buffering\n\nFor the last two cases, `size` is a hint for the size of the buffer, in\nbytes. The default is an appropriate size.\n\nThe specific behavior of each mode is non portable; check the underlying\nISO C function `setvbuf` in your platform for more details.
sin math.sin(x)\nReturns the sine of `x` (assumed to be in radians).
sinh math.sinh(x)\nReturns the hyperbolic sine of `x`.\n\nDeprecated in Lua 5.3.
-sort table.sort(list [, comp])\nSorts list elements in a given order, *in-place*, from `list[1]` to\n`list[#list]`. If `comp` is given, then it must be a function that receives\ntwo list elements and returns true when the first element must come before\nthe second in the final order (so that, after the sort, `i < j` implies\n`not comp(list[j],list[i])` will be true after the sort). If `comp` is not\ngiven, then the standard Lua operator `<` is used instead.\n\nNote that the `comp` function must not define a string partial order over the\nelements in the list; that is, it must be asymmetric and transitive.\nOtherwise, no valid sort may be possible.\n\nThe sort algorithm is not stable; that is, elements not comparable by the\ngiven order (e.g., equal elements) may have their relative positions changed\nby the sort.
+sort table.sort(list [, comp])\nSorts the list elements in a given order, *in-place*, from `list[1]` to\n`list[#list]`. If `comp` is given, then it must be a function that receives\ntwo list elements and returns true when the first element must come before\nthe second in the final order (so that, after the sort, `i < j` implies\n`not comp(list[j],list[i])` will be true after the sort). If `comp` is not\ngiven, then the standard Lua operator `<` is used instead.\n\nNote that the `comp` function must not define a string partial order over the\nelements in the list; that is, it must be asymmetric and transitive.\nOtherwise, no valid sort may be possible.\n\nThe sort algorithm is not stable; that is, elements not comparable by the\ngiven order (e.g., equal elements) may have their relative positions changed\nby the sort.
sqrt math.sqrt(x)\nReturns the square root of `x`. (You can also use the expression `x^0.5`\nto compute this value.)
-status coroutine.status(co)\nReturns the status of coroutine `co`, as a string: `"running"`, if\nthe coroutine is running (that is, it called `status`); `"suspended"`, if\nthe coroutine is suspended in a call to `yield`, or if it has not started\nrunning yet; `"normal"` if the coroutine is active but not running (that\nis, it has resumed another coroutine); and `"dead"` if the coroutine has\nfinished its body function, or if it has stopped with an error.
+status coroutine.status(co)\nReturns the status of the coroutine `co`, as a string: `"running"`, if\nthe coroutine is running (that is, it is the one that called `status`);\n`"suspended"`, if the coroutine is suspended in a call to `yield`, or if it\nhas not started running yet; `"normal"` if the coroutine is active but not\nrunning (that is, it has resumed another coroutine); and `"dead"` if the\ncoroutine has finished its body function, or if it has stopped with an error.
stderr io.stderr (file)\nStandard error.
stdin io.stdin (file)\nStandard in.
stdout io.stdout (file)\nStandard out.
@@ -191,12 +192,12 @@ symlinkattributes lfs.symlinkattributes(filepath [, aname])\nIdentical to lfs.at
table _G.table (module)\nLua table module.
tan math.tan(x)\nReturns the tangent of `x` (assumed to be in radians).
tanh math.tanh(x)\nReturns the hyperbolic tangent of `x`.\n\nDeprecated in Lua 5.3.
-time os.time([table])\nReturns the current time when called without arguments, or a time\nrepresenting the date and time specified by the given table. This table\nmust have fields `year`, `month`, and `day`, and may have fields `hour`\n(default is 12), `min` (default is 0), `sec` (default is 0), and `isdst`\n(default is nil). For a description of these fields, see the `os.date`\nfunction.\n\nThe returned value is a number, whose meaning depends on your system. In\nPOSIX, Windows, and some other systems, this number counts the number of\nseconds since some given start time (the "epoch"). In other systems, the\nmeaning is not specified, and the number returned by `time` can be used only\nas an argument to `os.date` and `os.difftime`.
+time os.time([table])\nReturns the current time when called without arguments, or a time\nrepresenting the date and time specified by the given table. This table\nmust have fields `year`, `month`, and `day`, and may have fields `hour`\n(default is 12), `min` (default is 0), `sec` (default is 0), and `isdst`\n(default is nil). For a description of these fields, see the `os.date`\nfunction.\n\nWhen the function is called, the values in these fields do not need to be\ninside their valid ranges. For instance, if `sec` is -10, it means 10 seconds\nbefore the time specified by the other fields; if `hour` is 1000, it means\n1000 hours after the time specified by the other fields.\n\nThe returned value is a number, whose meaning depends on your system. In\nPOSIX, Windows, and some other systems, this number counts the number of\nseconds since some given start time (the "epoch"). In other systems, the\nmeaning is not specified, and the number returned by `time` can be used only\nas an argument to `os.date` and `os.difftime`.\n\nWhen called with a table, `os.time` also normalizes all the fields documented\nin the `os.date` function, so that they represent the same time as before the\ncall but with values inside their valid ranges.
tmpfile io.tmpfile()\nIn case of success, returns a handle for a temporary file. This file is\nopened in update mode and it is automatically removed when the program ends.
tmpname os.tmpname()\nReturns a string with a file name that can be used for a temporary\nfile. The file must be explicitly opened before its use and explicitly\nremoved when no longer needed.\n\nOn POSIX systems, this function also creates a file with that name, to avoid\nsecurity risks. (Someone else might create the file with wrong permissions in\nthe time between getting the name and creating the file.) You still have to\nopen the file to use it and to remove it (even if you do not use it).\n\nWhen possible, you may prefer to use `io.tmpfile`, which automatically\nremoves the file when the program ends.
tointeger math.tointeger(x)\nIf the value `x` is convertible to an integer, returns that integer.\nOtherwise, returns nil.\n\nNew in Lua 5.3.
-tonumber _G.tonumber(e [, base])\nWhen called with no `base`, `tonumber` tries to convert its argument to a\nnumber. If the argument is already a number or a string convertible to a\nnumber, then `tonumber` returns this number; otherwise, it\nreturns nil.\n\nThe conversion of strings can result in integers or floats, according to the\nlexical conventions of Lua (see §3.1). (The string may have leading and\ntrailing spaces and a sign.)\n\nWhen called with `base`, then `e` must be a string to be interpreted as an\ninteger numeral in that base. The base may be any integer between 2 and 36,\ninclusive. In bases above 10, the letter '`A`' (in either upper or lower\ncase) represents 10, '`B`' represents 11, and so forth, with '`Z`'\nrepresenting 35. If the string `e` is not a valid numeral in the given base,\nthe function returns nil
-tostring _G.tostring(v)\nReceives a value of any type and converts it to a string in a human-readable\nformat. Floats always produce strings with some floating-point indication\n(either a decimal dot or an exponent). (For complete control of how numbers\nare converted, use `string.format`.)\n\nIf the metatable of `v` has a `__tostring` field, then `tostring` calls the\ncorresponding value with `v` as argument, and uses the result of the call as\nits result.
+tonumber _G.tonumber(e [, base])\nWhen called with no `base`, `tonumber` tries to convert its argument to a\nnumber. If the argument is already a number or a string convertible to a\nnumber, then `tonumber` returns this number; otherwise, it\nreturns nil.\n\nThe conversion of strings can result in integers or floats, according to the\nlexical conventions of Lua (see §3.1). The string may have leading and\ntrailing spaces and a sign.\n\nWhen called with `base`, then `e` must be a string to be interpreted as an\ninteger numeral in that base. The base may be any integer between 2 and 36,\ninclusive. In bases above 10, the letter '`A`' (in either upper or lower\ncase) represents 10, '`B`' represents 11, and so forth, with '`Z`'\nrepresenting 35. If the string `e` is not a valid numeral in the given base,\nthe function returns nil
+tostring _G.tostring(v)\nReceives a value of any type and converts it to a string in a human-readable\nformat. Floats always produce strings with some floating-point indication\n(either a decimal dot or an exponent).\n\nIf the metatable of `v` has a `__tostring` field, then `tostring` calls the\ncorresponding value with `v` as argument, and uses the result of the call as\nits result. Otherwise, if the metatable of `v` has a `__name` field with a\nstring value, `tostring` may use that string in its final result.\n\nFor complete control of how numbers are converted, use `string.format`.
touch lfs.touch(filepath [, atime [, mtime]])\nSet access and modification times of a file. This function is a bind to utime\nfunction. The first argument is the filename, the second argument (atime) is\nthe access time, and the third argument (mtime) is the modification time.\nBoth times are provided in seconds (which should be generated with Lua\nstandard function os.time). If the modification time is omitted, the access\ntime provided is used; if both times are omitted, the current time is used.\n\nReturns true in case of success or nil, an error message and a\nsystem-dependent error code in case of error.
traceback debug.traceback([thread, ] [message] [, level])\nIf `message` is present but is neither a string nor nil, this function\nreturns `message` without further processing. Otherwise, it returns a string\nwith a traceback of the call stack. The optional `message` string is appended\nat the beginning of the traceback. An optional `level` number tells at which\nlevel to start the traceback (default is 1, the function calling\n`traceback`).
type _G.type(v)\nReturns the type of its only argument, coded as a string. The possible\nresults of this function are "\n`nil`" (a string, not the value nil), "`number`", "`string`", "`boolean`",\n"`table`", "`function`", "`thread`", and "`userdata`".
@@ -213,7 +214,8 @@ upvalueid debug.upvalueid(f, n)\nReturns a unique identifier (as a light userdat
upvaluejoin debug.upvaluejoin(f1, n1, f2, n2)\nMake the `n1`-th upvalue of the Lua closure `f1` refer to the `n2`-th upvalue\nof the Lua closure `f2`.\n\nNew in Lua 5.2.
utf8 _G.utf8 (module)\nLua utf8 module.
version lpeg.version()\nReturns a string with the running version of LPeg.
-wrap coroutine.wrap(f)\nCreates a new coroutine, with body `f`. `f` must be a Lua\nfunction. Returns a function that resumes the coroutine each time it is\ncalled. Any arguments passed to the function behave as the extra arguments to\n`resume`. Returns the same values returned by `resume`, except the first\nboolean. In case of error, propagates the error.
+warn _G.warn(msg1, ···)\nEmits a warning with a message composed by the concatenation of all its\narguments (which should be strings).\n\nBy convention, a one-piece message starting with '`@`' is intended to be a\n*control message*, which is a message to the warning system itself. In\nparticular, the standard warning function in Lua recognizes the control\nmessages "`@off`", to stop the emission of warnings, and "`@on`", to\n(re)start the emission; it ignores unknown control messages.\n\nNew in Lua 5.4.
+wrap coroutine.wrap(f)\nCreates a new coroutine, with body `f`; `f` must be a Lua\nfunction. Returns a function that resumes the coroutine each time it is\ncalled. Any arguments passed to this function behave as the extra arguments\nto `resume`. The function returns the same values returned by `resume`,\nexcept the first boolean. In case of error, the function closes the coroutine\nand propagates the error.
write file:write(···)\nWrites the value of each of its arguments to `file`. The arguments must be\nstrings or numbers.\n\nIn case of success, this function returns `file`. Otherwise it returns nil\nplus a string describing the error.
write io.write(···)\nEquivalent to `io.output():write(···)`.
xor bit32.xor(...)\nReturns the bitwise "exclusive or" of its operands.\n\nNew in Lua 5.2.\nDeprecated in Lua 5.3.
diff --git a/modules/lua/lua.luadoc b/modules/lua/lua.luadoc
index f4b16f79..8dc89938 100644
--- a/modules/lua/lua.luadoc
+++ b/modules/lua/lua.luadoc
@@ -8,13 +8,13 @@
-- not affect any environment, nor vice versa.
-- @field _VERSION (string)
-- A global variable (not a function) that holds a string containing the
--- running Lua version. The current value of this variable is "`Lua 5.3`".
+-- running Lua version. The current value of this variable is "`Lua 5.4`".
local _G
---
--- Calls `error` if the value of its argument `v` is false (i.e., nil or false);
--- otherwise, returns all its arguments. In case of error, `message` is the
--- error object; when absent, it defaults to "assertion failed!".
+-- Raises an error if the value of its argument `v` is false (i.e., nil or
+-- false); otherwise, returns all its arguments. In case of error, `message` is
+-- the error object; when absent, it defaults to "assertion failed!".
function assert(v [, message]) end
---
@@ -26,32 +26,37 @@ function assert(v [, message]) end
-- "restart": restarts automatic execution of the garbage collector.
-- "count": returns the total memory in use by Lua in Kbytes. The value has a
-- fractional part, so that it multiplied by 1024 gives the exact
--- number of bytes in use by Lua (except for overflows).
+-- number of bytes in use by Lua.
-- "step": performs a garbage-collection step. The step "size" is controlled
-- by `arg`. With a zero value, the collector will perform one basic
-- (indivisible) step. For non-zero values, the collector will perform
--- as if that amount of memory (in KBytes) had been allocated by Lua.
+-- as if that amount of memory (in Kbytes) had been allocated by Lua.
-- Returns true if the step finished a collection cycle.
--- "setpause": sets `arg` as the new value for the *pause* of the collector
--- (see §2.5). Returns the previous value for *pause*.
--- "setstepmul": sets `arg` as the new value for the *step multiplier*
--- of the collector (see §2.5). Returns the previous value for
--- *step*.
-- "isrunning": returns a boolean that tells whether the collector is running
-- (i.e., not stopped).
+-- "incremental": change the collector mode to incremental. This option can be
+-- followed by three numbers: the garbage-collector pause, the
+-- step multiplier, and the step size (see §2.5.1). A zero means to not
+-- change that value.
+-- "generational": change the collector mode to generational. This option can
+-- be followed by two numbers: the garbage-collector minor
+-- multiplier and the major multiplier (see §2.5.2). A zero
+-- means to not change that value.
+--
+-- See §2.5 for more details about garbage collection and some of these options.
function collectgarbage([opt [, arg]]) end
---
--- Opens the named file and executes its contents as a Lua chunk. When
+-- Opens the named file and executes its content as a Lua chunk. When
-- called without arguments,
--- `dofile` executes the contents of the standard input (`stdin`). Returns
+-- `dofile` executes the content of the standard input (`stdin`). Returns
-- all values returned by the chunk. In case of errors, `dofile` propagates
--- the error to its caller (that is, `dofile` does not run in protected mode).
+-- the error to its caller. (That is, `dofile` does not run in protected mode.)
function dofile([filename]) end
---
--- Terminates the last protected function called and returns `message`
--- as the error object. Function `error` never returns.
+-- Raises an error (see §2.3) with `message` as the error object. This function
+-- never returns.
--
-- Usually, `error` adds some information about the error position at the
-- beginning of the message, if the message is a string. The `level` argument
@@ -85,39 +90,43 @@ function getmetatable(object) end
-- for i,v in ipairs(t) do *body* end
--
-- will iterate over the key-value pairs (`1,t[1]`), (`2,t[2]`), ···, up to the
--- first nil value.
+-- first absent index.
function ipairs(t) end
---
-- Loads a chunk.
--
--- If `chunk` is a string, the chunk is this string. If `chunk` is a function, `load`
--- calls it repeatedly to get the chunk pieces. Each call to `chunk` must return a
--- string that concatenates with previous results. A return of an empty string,
--- nil, or no value signals the end of the chunk.
+-- If `chunk` is a string, the chunk is this string. If `chunk` is a function,
+-- `load` calls it repeatedly to get the chunk pieces. Each call to `chunk` must
+-- return a string that concatenates with previous results. A return of an empty
+-- string, nil, or no value signals the end of the chunk.
--
--- If there are no syntactic errors, returns the compiled chunk as a function;
--- otherwise, returns nil plus the error message.
+-- If there are no syntactic errors, `load` returns the compiled chunk as a
+-- function; otherwise, it returns nil plus the error message.
--
--- If the resulting function has upvalues, the first upvalue is set to the value
--- of `env`, if that parameter is given, or to the value of the global
--- environment. Other upvalues are initialized with nil. (When you load a main
--- chunk, the resulting function will always have exactly one upvalue, the
--- `_ENV` variable (see §2.2). However, when you load a binary chunk created
--- from a function (see `string.dump`), the resulting function can have an
--- arbitrary number of upvalues.) All upvalues are fresh, that is, they are not
--- shared with any other function.
+-- When you load a main chunk, the resulting function will always have exactly
+-- one upvalue, the `_ENV` variable (see §2.2). However, when you load a binary
+-- chunk created from a function (see `string.dump`), the resulting function can
+-- have an arbitrary number of upvalues, and there is no guarantee that its
+-- first upvalue will be the `_ENV` variable. (A non-main function may not even
+-- have an `_ENV` upvalue.)
+--
+-- Regardless, if the resulting function has any upvalues, its first upvalue is
+-- set to the value of `env`, if that parameter is given, or to the value of the
+-- global environment. Other upvalues are initialized with nil. All upvalues are
+-- fresh, that is, they are not shared with any other function.
--
-- `chunkname` is used as the name of the chunk for error messages and debug
--- information (see §4.9). When absent, it defaults to `chunk`, if `chunk` is a
+-- information (see §4.7). When absent, it defaults to `chunk`, if `chunk` is a
-- string, or to "`=(load)`" otherwise.
--
-- The string `mode` controls whether the chunk can be text or binary (that is,
-- a precompiled chunk). It may be the string "`b`" (only binary chunks), "`t`"
-- (only text chunks), or "`bt`" (both binary and text). The default is "`bt`".
--
--- Lua does not check the consistency of binary chunks. Maliciously crafted
--- binary chunks can crash the interpreter.
+-- It is safe to load malformed binary chunks; `load` signals an appropriate
+-- error. However, Lua does not check the consistency of the code inside binary
+-- chunks; running maliciously crafted bytecode can crash the interpreter.
function load(chunk [, chunkname [, mode [, env]]]) end
---
@@ -155,12 +164,13 @@ function module(name [, ···]) end
---
-- Allows a program to traverse all fields of a table. Its first argument is
--- a table and its second argument is an index in this table. `next` returns
--- the next index of the table and its associated value. When called with nil
--- as its second argument, `next` returns an initial index and its associated
--- value. When called with the last index, or with nil in an empty table, `next`
--- returns nil. If the second argument is absent, then it is interpreted as
--- nil. In particular, you can use `next(t)` to check whether a table is empty.
+-- a table and its second argument is an index in this table. A call to `next`
+-- returns the next index of the table and its associated value. When called
+-- with nil as its second argument, `next` returns an initial index and its
+-- associated value. When called with the last index, or with nil in an empty
+-- table, `next` returns nil. If the second argument is absent, then it is
+-- interpreted as nil. In particular, you can use `next(t)` to check whether a
+-- table is empty.
--
-- The order in which the indices are enumerated is not specified, *even for
-- numeric indices*. (To traverse a table in numeric order, use a numerical
@@ -168,7 +178,7 @@ function module(name [, ···]) end
--
-- The behavior of `next` is undefined if, during the traversal, you assign any
-- value to a non-existent field in the table. You may however modify existing
--- fields. In particular, you may clear existing fields.
+-- fields. In particular, you may set existing fields to nil.
function next(table [, index]) end
---
@@ -187,20 +197,22 @@ function next(table [, index]) end
function pairs(t) end
---
--- Calls function `f` with the given arguments in *protected mode*. This
+-- Calls the function `f` with the given arguments in *protected mode*. This
-- means that any error inside `f` is not propagated; instead, `pcall` catches
-- the error and returns a status code. Its first result is the status code (a
-- boolean), which is true if the call succeeds without errors. In such case,
-- `pcall` also returns all results from the call, after this first result. In
--- case of any error, `pcall` returns false plus the error message.
+-- case of any error, `pcall` returns false plus the error object. Note that
+-- errors caught by `pcall` do not call a message handler.
function pcall(f [, arg1, ···]) end
---
--- Receives any number of arguments and prints their values to `stdout`, using
--- the `tostring` function to convert each argument to a string. `print` is not
--- intended for formatted output, but only as a quick way to show a value,
--- for instance for debugging. For complete control over the output, use
--- `string.format` and `io.write`.
+-- Receives any number of arguments and prints their values to `stdout`,
+-- converting each argument to a string following the same rules of `tostring`.
+--
+-- The function `print` is not intended for formatted output, but only as a
+-- quick way to show a value, for instance for debugging. For complete control
+-- over the output, use `string.format` and `io.write`.
function print(···) end
---
@@ -209,8 +221,8 @@ function print(···) end
function rawequal(v1, v2) end
---
--- Gets the real value of `table[index]`, without invoking the `__index`
--- metamethod. `table` must be a table; `index` may be any value.
+-- Gets the real value of `table[index]`, without using the `__index`
+-- metavalue. `table` must be a table; `index` may be any value.
function rawget(table, index) end
---
@@ -223,8 +235,8 @@ function rawget(table, index) end
function rawlen(v) end
---
--- Sets the real value of `table[index]` to `value`, without invoking the
--- `__newindex` metamethod. `table` must be a table, `index` any value different
+-- Sets the real value of `table[index]` to `value`, without using the
+-- `__newindex` metavalue. `table` must be a table, `index` any value different
-- from nil and NaN, and `value` any Lua value.
--
-- This function returns `table`.
@@ -248,12 +260,14 @@ function setfenv(f, table) end
function select(index, ···) end
---
--- Sets the metatable for the given table. (To change the metatable of other
--- types from Lua code, you must use the debug library.) If `metatable` is nil,
--- removes the metatable of the given table. If the original metatable has a
--- `__metatable` field, raises an error.
+-- Sets the metatable for the given table. If `metatable` is nil, removes the
+-- metatable of the given table. If the original metatable has a `__metatable`
+-- field, raises an error.
--
-- This function returns `table`.
+--
+-- To change the metatable of other types from Lua code, you must use the debug
+-- library (see §6.10).
function setmetatable(table, metatable) end
---
@@ -263,8 +277,8 @@ function setmetatable(table, metatable) end
-- returns nil.
--
-- The conversion of strings can result in integers or floats, according to the
--- lexical conventions of Lua (see §3.1). (The string may have leading and
--- trailing spaces and a sign.)
+-- lexical conventions of Lua (see §3.1). The string may have leading and
+-- trailing spaces and a sign.
--
-- When called with `base`, then `e` must be a string to be interpreted as an
-- integer numeral in that base. The base may be any integer between 2 and 36,
@@ -277,12 +291,14 @@ function tonumber(e [, base]) end
---
-- Receives a value of any type and converts it to a string in a human-readable
-- format. Floats always produce strings with some floating-point indication
--- (either a decimal dot or an exponent). (For complete control of how numbers
--- are converted, use `string.format`.)
+-- (either a decimal dot or an exponent).
--
-- If the metatable of `v` has a `__tostring` field, then `tostring` calls the
-- corresponding value with `v` as argument, and uses the result of the call as
--- its result.
+-- its result. Otherwise, if the metatable of `v` has a `__name` field with a
+-- string value, `tostring` may use that string in its final result.
+--
+-- For complete control of how numbers are converted, use `string.format`.
function tostring(v) end
---
@@ -303,23 +319,44 @@ function type(v) end
function unpack(list [, i [, j]]) end
---
+-- Emits a warning with a message composed by the concatenation of all its
+-- arguments (which should be strings).
+--
+-- By convention, a one-piece message starting with '`@`' is intended to be a
+-- *control message*, which is a message to the warning system itself. In
+-- particular, the standard warning function in Lua recognizes the control
+-- messages "`@off`", to stop the emission of warnings, and "`@on`", to
+-- (re)start the emission; it ignores unknown control messages.
+--
+-- New in Lua 5.4.
+function warn(msg1, ···) end
+
+---
-- This function is similar to `pcall`, except that it sets a new message
-- handler `msgh`.
function xpcall(f, msgh [, arg1, ···]) end
---
+-- Closes coroutine `co`, that is, closes all its pending to-be-closed variables
+-- and puts the coroutine in a dead state. The given coroutine must be dead or
+-- suspended. In case of error closing some variable, returns false plus the
+-- error object; otherwise returns true.
+function coroutine.close(co) end
+
+---
-- Creates a new coroutine, with body `f`. `f` must be a Lua
-- function. Returns this new coroutine, an object with type `"thread"`.
function coroutine.create(f) end
---
--- Returns true when the running coroutine can yield.
+-- Returns true when the coroutine `co` can yield. The default for `co` is the
+-- running coroutine.
--
--- A running coroutine is yieldable if it is not the main thread and it is not
--- inside a non-yieldable C function.
+-- A coroutine is yieldable if it is not the main thread and it is not inside a
+-- non-yieldable C function.
--
-- New in Lua 5.3.
-function coroutine.isyieldable() end
+function coroutine.isyieldable([co]) end
---
-- Starts or continues the execution of coroutine `co`. The first time
@@ -340,20 +377,21 @@ function coroutine.resume(co [, val1, ···]) end
function coroutine.running() end
---
--- Returns the status of coroutine `co`, as a string: `"running"`, if
--- the coroutine is running (that is, it called `status`); `"suspended"`, if
--- the coroutine is suspended in a call to `yield`, or if it has not started
--- running yet; `"normal"` if the coroutine is active but not running (that
--- is, it has resumed another coroutine); and `"dead"` if the coroutine has
--- finished its body function, or if it has stopped with an error.
+-- Returns the status of the coroutine `co`, as a string: `"running"`, if
+-- the coroutine is running (that is, it is the one that called `status`);
+-- `"suspended"`, if the coroutine is suspended in a call to `yield`, or if it
+-- has not started running yet; `"normal"` if the coroutine is active but not
+-- running (that is, it has resumed another coroutine); and `"dead"` if the
+-- coroutine has finished its body function, or if it has stopped with an error.
function coroutine.status(co) end
---
--- Creates a new coroutine, with body `f`. `f` must be a Lua
+-- Creates a new coroutine, with body `f`; `f` must be a Lua
-- function. Returns a function that resumes the coroutine each time it is
--- called. Any arguments passed to the function behave as the extra arguments to
--- `resume`. Returns the same values returned by `resume`, except the first
--- boolean. In case of error, propagates the error.
+-- called. Any arguments passed to this function behave as the extra arguments
+-- to `resume`. The function returns the same values returned by `resume`,
+-- except the first boolean. In case of error, the function closes the coroutine
+-- and propagates the error.
function coroutine.wrap(f) end
---
@@ -363,14 +401,16 @@ function coroutine.yield(···) end
---
-- Loads the given module. The function starts by looking into the
--- `package.loaded` table to determine whether `modname` is already
--- loaded. If it is, then `require` returns the value stored at
--- `package.loaded[modname]`. Otherwise, it tries to find a *loader* for
--- the module.
---
--- To find a loader, `require` is guided by the `package.searchers` sequence. By
--- changing this sequence, we can change how `require` looks for a module. The
--- following explanation is based on the default configuration for
+-- `package.loaded` table to determine whether `modname` is already loaded. If
+-- it is, then `require` returns the value stored at `package.loaded[modname]`.
+-- (The absence of a second result in this case signals that this call did not
+-- have to load the module.) Otherwise, it tries to find a *loader* for the
+-- module.
+--
+-- To find a loader, `require` is guided by the table `package.searchers`. Each
+-- item in this table is a search function, that searches for the module in a
+-- particular way. By changing this table, we can change how `require` looks for
+-- a module. The following explanation is based on the default configuration for
-- `package.searchers`.
--
-- First `require` queries `package.preload[modname]`. If it has a value,
@@ -381,13 +421,17 @@ function coroutine.yield(···) end
-- `package.searchers`).
--
-- Once a loader is found, `require` calls the loader with two arguments:
--- `modname` and an extra value dependent on how it got the loader. (If the
--- loader came from a file, this extra value is the file name.) If the loader
+-- `modname` and an extra value, a *loader data*, also returned by the searcher.
+-- The loader data can be any value useful to the module; for the default
+-- searchers, it indicates where the loader was found. (For instance, if the
+-- loader came from a file, this extra value is the file path.) If the loader
-- returns any non-nil value, `require` assigns the returned value to
-- `package.loaded[modname]`. If the loader does not return a non-nil value and
-- has not assigned any value to `package.loaded[modname]`, then `require`
-- assigns true to this entry. In any case, `require` returns the final value of
--- `package.loaded[modname]`.
+-- `package.loaded[modname]`. Besides that value, `require` also returns as a
+-- second result the loader data returned by the searcher, which indicates how
+-- `require` found the module.
--
-- If there is any error loading or running the module, or if it cannot find
-- any loader for the module, then `require` raises an error.
@@ -413,9 +457,9 @@ function require(modname) end
--
-- New in Lua 5.2.
-- @field cpath (string)
--- The path used by `require` to search for a C loader.
+-- A string with the path used by `require` to search for a C loader.
-- Lua initializes the C path `package.cpath` in the same way it initializes
--- the Lua path `package.path`, using the environment variable `LUA_CPATH_5_3`
+-- the Lua path `package.path`, using the environment variable `LUA_CPATH_5_4`
-- or the environment variable `LUA_CPATH` or a default path defined in
-- `luaconf.h`.
-- @field loaded (table)
@@ -429,24 +473,26 @@ function require(modname) end
--
-- Deprecated in Lua 5.2.
-- @field path (string)
--- The path used by `require` to search for a Lua loader.
+-- A string with the path used by `require` to search for a Lua loader.
-- At start-up, Lua initializes this variable with the value of the
--- environment variable `LUA_PATH_5_3` or the environment variable `LUA_PATH`
+-- environment variable `LUA_PATH_5_4` or the environment variable `LUA_PATH`
-- or with a default path defined in `luaconf.h`, if those environment
--- variables are not defined. Any "`;;`" in the value of the environment
+-- variables are not defined. A "`;;`" in the value of the environment
-- variable is replaced by the default path.
-- @field preload (table)
-- A table to store loaders for specific modules (see `require`).
-- This variable is only a reference to the real table; assignments to this
-- variable do not change the table used by `require`.
-- @field searchers (table)
--- A table used by `require` to control how to load modules.
+-- A table used by `require` to control how to find modules.
-- Each entry in this table is a *searcher function*. When looking for a
-- module, `require` calls each of these searchers in ascending order, with
--- the module name (the argument given to `require`) as its sole parameter.
--- The function can return another function (the module *loader*) plus an
--- extra value that will be passed to that loader, or a string explaining why
--- it did not find that module (or nil if it has nothing to say).
+-- the module name (the argument given to `require`) as its sole argument.
+-- If the searcher finds the module, it returns another function, the module
+-- *loader*, plus an extra value, a *loader data*, that will be passed to that
+-- loader and returned as a second result by `require`. If it cannot find the
+-- module, it returns a string explaining why (or nil if it has nothing to
+-- say).
-- Lua initializes this table with four functions.
-- The first searcher simply looks for a loader in the `package.preload`
-- table.
@@ -474,8 +520,11 @@ function require(modname) end
-- can pack several C submodules into one single library, with each submodule
-- keeping its original open function.
-- All searchers except the first one (preload) return as the extra value the
--- file name where the module was found, as returned by `package.searchpath`.
--- The first searcher returns no extra value.
+-- file path where the module was found, as returned by `package.searchpath`.
+-- The first searcher always returns the string "`:preload:`".
+-- Searchers should raise no errors and have no side effects in Lua. (They may
+-- have side effects in C, for instance by linking the application with a
+-- library.)
--
-- New in Lua 5.2.
local package
@@ -499,6 +548,12 @@ local package
-- This function is not supported by Standard C. As such, it is only available
-- on some platforms (Windows, Linux, Mac OS X, Solaris, BSD, plus other Unix
-- systems that support the `dlfcn` standard).
+--
+-- This function is inherently insecure, as it allows Lua to call any function
+-- in any readable dynamic library in the system. (Lua calls any function
+-- assuming the function has a proper prototype and respects a proper protocol
+-- (see lua_CFunction). Therefore, calling an arbitrary function in an arbitrary
+-- dynamic library more often than not results in an access violation.)
function package.loadlib(libname, funcname) end
---
@@ -553,9 +608,10 @@ function string.char(···) end
-- variable names, lines, etc.).
--
-- Functions with upvalues have only their number of upvalues saved. When
--- (re)loaded, those upvalues receive fresh instances containing nil. (You can
--- use the debug library to serialize and reload the upvalues of a function in a
--- way adequate to your needs.)
+-- (re)loaded, those upvalues receive fresh instances. (See the `load` function
+-- for details about how these upvalues are initialized. You can use the debug
+-- library to serialize and reload the upvalues of a function in a way adequate
+-- to your needs.)
function string.dump(function [, strip]) end
---
@@ -566,7 +622,7 @@ function string.dump(function [, strip]) end
-- and can be negative. A value of true as a fourth, optional argument `plain`
-- turns off the pattern matching facilities, so the function does a plain
-- "find substring" operation, with no characters in `pattern` being considered
--- magic. Note that if `plain` is given, then `init` must be given as well.
+-- magic.
--
-- If the pattern has captures, then in a successful match the captured values
-- are also returned, after the two indices.
@@ -574,14 +630,17 @@ function string.find(s, pattern [, init [, plain]]) end
---
-- Returns a formatted version of its variable number of arguments following the
--- description given in its first argument (which must be a string). The format
+-- description given in its first argument, which must be a string. The format
-- string follows the same rules as the ISO C function `sprintf`. The only
--- differences are that the options/modifiers `*`, `h`, `L`, `l`, `n`, and `p`
--- are not supported and that there is an extra option, `q`.
+-- differences are that the conversion specifiers and modifiers `*`, `h`, `L`,
+-- `l`, and `n` are not supported and that there is an extra specifier, `q`.
--
--- The `q` option formats a string between double quotes, using escape sequences
--- when necessary to ensure that it can safely be read back by the Lua
--- interpreter. For instance, the call
+-- The specifier `q` formats booleans, nil, numbers, and strings in a way that
+-- the result is a valid constant in Lua source code. Booleans and nil are
+-- written in the obvious way (`true`, `false`, `nil`). Floats are written in
+-- hexadecimal, to preserve full precision. A string is written between double
+-- quotes, using escape sequences when necessary to ensure that it can safely be
+-- read back by the Lua interpreter. For instance, the call
--
-- string.format('%q', 'a string with "quotes" and \n new line')
--
@@ -590,18 +649,30 @@ function string.find(s, pattern [, init [, plain]]) end
-- "a string with \"quotes\" and \
-- new line"
--
--- Options `A` and `a` (when available), `E`, `e`, `f`, `G`, and `g` all expect
--- a number as argument. Options `c`, `d`, `i`, `o`, `u`, `X`, and `x` expect an
--- integer. Option `q` expects a string. Option `s` expects a string; if its
--- argument is not a string, it is converted to one following the same rules of
--- `tostring`. If the option has any modifier (flags, width, length), the string
--- argument should not contain zeros.
+-- This specifier does not support modifiers (flags, width, length).
+--
+-- The conversion specifiers `A` and `a` (when available), `E`, `e`, `f`, `G`,
+-- and `g` all expect a number as argument. The specifiers `c`, `d`, `i`, `o`,
+-- `u`, `X`, and `x` expect an integer. When Lua is compiled with a C89
+-- compiler, the specifiers `A` and `a` (hexadecimal floats) do not support
+-- modifiers.
+--
+-- The specifier `s` expects a string; if its argument is not a string, it is
+-- converted to one following the same rules of `tostring`. If the specifier has
+-- any modifier, the corresponding string argument should not contain zeros.
+--
+-- The specifier `p` formats the pointer returned by `lua_topointer`. That gives
+-- a unique string identifier for tables, userdata, threads, strings, and
+-- functions. For other values (numbers, nil, booleans), this specifier results
+-- in a string representing the pointer `NULL`.
function string.format(formatstring, ···) end
---
-- Returns an iterator function that, each time it is called, returns the
-- next captures from `pattern` (see §6.4.1) over the string `s`. If `pattern`
--- specifies no captures, then the whole match is produced in each call.
+-- specifies no captures, then the whole match is produced in each call. A
+-- third, optional argument `init` specifies where to start the search; its
+-- default value is 1 and can be negative.
--
-- As an example, the following loop will iterate over all the words from string
-- `s`, printing one per line:
@@ -622,7 +693,7 @@ function string.format(formatstring, ···) end
--
-- For this function, a caret '`^`' at the start of a pattern does not work as
-- an anchor, as this would prevent the iteration.
-function string.gmatch(s, pattern) end
+function string.gmatch(s, pattern [, init]) end
---
-- Returns a copy of `s` in which all (or the first `n`, if given)
@@ -634,7 +705,7 @@ function string.gmatch(s, pattern) end
-- If `repl` is a string, then its value is used for replacement. The character
-- `%` works as an escape character: any sequence in `repl` of the form `%d`,
-- with `d` between 1 and 9, stands for the value of the `d`-th captured
--- substring. The sequence `%0` stands for the whole match. The sequence `%%`
+-- substring; the sequence `%0` stands for the whole match; the sequence `%%`
-- stands for a single `%`.
--
-- If `repl` is a table, then the table is queried for every match, using
@@ -665,9 +736,9 @@ function string.gmatch(s, pattern) end
-- return load(s)()
-- end)
-- --> x="4+5 = 9"
--- local t = {name="lua", version="5.3"}
+-- local t = {name="lua", version="5.4"}
-- x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t)
--- --> x="lua-5.3.tar.gz"
+-- --> x="lua-5.4.tar.gz"
function string.gsub(s, pattern, repl [, n]) end
---
@@ -682,17 +753,16 @@ function string.len(s) end
function string.lower(s) end
---
--- Looks for the first *match* of `pattern` (see §6.4.1) in the string `s`. If
--- it finds one, then `match` returns the captures from the pattern; otherwise
--- it returns nil. If `pattern` specifies no captures, then the whole match
--- is returned. A third, optional numerical argument `init` specifies where
--- to start the search; its default value is 1 and can be negative.
+-- Looks for the first *match* of the `pattern` (see §6.4.1) in the string `s`.
+-- If it finds one, then `match` returns the captures from the pattern;
+-- otherwise it returns nil. If `pattern` specifies no captures, then the whole
+-- match is returned. A third, optional numerical argument `init` specifies
+-- where to start the search; its default value is 1 and can be negative.
function string.match(s, pattern [, init]) end
---
--- Returns a binary string containing the values `v1`, `v2`, etc. packed (that
--- is, serialized in binary form) according to the format string `fmt` (see
--- §6.4.2).
+-- Returns a binary string containing the values `v1`, `v2`, etc. serialized in
+-- binary form (packed) according to the format string `fmt` (see §6.4.2).
--
-- New in Lua 5.3.
function string.pack(fmt, v1, v2, ···) end
@@ -752,7 +822,7 @@ function string.upper(s) end
-- @class table
-- @name utf8
-- @field charpattern (string)
--- The pattern (a string, not a function) "[\0-\x7F\xC2-\xF4][\x80-\xBF]*"
+-- The pattern (a string, not a function) "[\0-\x7F\xC2-\xFD][\x80-\xBF]*"
-- (see §6.4.1), which matches exactly one UTF-8 byte sequence, assuming that
-- the subject is a valid UTF-8 string.
--
@@ -771,29 +841,47 @@ function utf8.char(···) end
--
-- for p, c in utf8.codes(s) do *body* end
--
--- will iterate over all characters in string `s`, with `p` being the position
--- (in bytes) and `c` the code point of each character. It raises an error if it
--- meets any invalid byte sequence.
+-- will iterate over all UTF-8 characters in string `s`, with `p` being the
+-- position (in bytes) and `c` the code point of each character. It raises an
+-- error if it meets any invalid byte sequence.
+--
+-- This function only accepts valid sequences (well formed and not overlong).
+-- By default, it only accepts byte sequences that result in valid Unicode code
+-- points, rejecting values greater than `10FFFF` and surrogates. The boolean
+-- argument `lax` lifts these checks, so that all values up to `0x7FFFFFFF` are
+-- accepted. (Not well formed and overlong sequences are still rejected.)
--
-- New in Lua 5.3.
-function utf8.codes(s) end
+function utf8.codes(s [, lax]) end
---
-- Returns the codepoints (as integers) from all characters in `s` that start
-- between byte position `i` and `j` (both included). The default for `i` is 1
-- and for `j` is `i`. It raises an error if it meets any invalid byte sequence.
--
+-- This function only accepts valid sequences (well formed and not overlong).
+-- By default, it only accepts byte sequences that result in valid Unicode code
+-- points, rejecting values greater than `10FFFF` and surrogates. The boolean
+-- argument `lax` lifts these checks, so that all values up to `0x7FFFFFFF` are
+-- accepted. (Not well formed and overlong sequences are still rejected.)
+--
-- New in Lua 5.3.
-function utf8.codepoint(s [, i [, j]]) end
+function utf8.codepoint(s [, i [, j [, lax]]]) end
---
-- Returns the number of UTF-8 characters in string `s` that start between
-- positions `i` and `j` (both inclusive). The default for `i` is 1 and for `j`
--- is -1. If it finds any invalid byte sequence, returns a false value plus the
--- position of the first invalid byte.
+-- is -1. If it finds any invalid byte sequence, returns nil plus the position
+-- of the first invalid byte.
+--
+-- This function only accepts valid sequences (well formed and not overlong).
+-- By default, it only accepts byte sequences that result in valid Unicode code
+-- points, rejecting values greater than `10FFFF` and surrogates. The boolean
+-- argument `lax` lifts these checks, so that all values up to `0x7FFFFFFF` are
+-- accepted. (Not well formed and overlong sequences are still rejected.)
--
-- New in Lua 5.3.
-function utf8.len(s [, i [, j]]) end
+function utf8.len(s [, i [, j [, lax]]]) end
---
-- Returns the position (in bytes) where the encoding of the `n`-th character of
@@ -821,8 +909,8 @@ function table.concat(list [, sep [, i [, j]]]) end
---
-- 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 that a call `table.insert(t,x)` inserts `x` at the end of list
--- `t`.
+-- `#list+1`, so that a call `table.insert(t,x)` inserts `x` at the end of the
+-- list `t`.
function table.insert(list, [pos,] value) end
---
@@ -834,10 +922,10 @@ function table.insert(list, [pos,] value) end
function table.maxn(table) end
---
--- Moves elements from table `a1` to table `a2`, performing the equivalent to
--- the following multiple assignment: `a2[t], ··· = a1[f], ···, a1[e]`. The
--- default for `a2` is `a1`. The destination range can overlap with the source
--- range. Index `f` must be positive.
+-- Moves elements from the table `a1` to the table `a2`, performing the
+-- equivalent to the following multiple assignment: `a2[t], ··· = a1[f], ···,
+-- a1[e]`. The default for `a2` is `a1`. The destination range can overlap with
+-- the source range. Index `f` must be positive.
--
-- Returns the destination table `a2`.
--
@@ -847,7 +935,7 @@ function table.move(a1, f, e, t [,a2]) end
---
-- Returns a new table with all parameters stored into keys 1, 2, etc. and with
-- a field "`n`" with the total number of parameters. Note that the resulting
--- table may not be a sequence.
+-- table may not be a sequence, if some arguments are nil.
--
-- New in Lua 5.2.
function table.pack(···) end
@@ -857,14 +945,14 @@ function table.pack(···) end
-- removed element. When `pos` is an integer between 1 and `#list`, it shifts
-- down the elements `list[pos+1], list[pos+2], ···, list[#list]` and erases
-- element `list[#list]`; The index `pos` can also be 0 when `#list` is 0, or
--- `#list + 1`; in those cases, the function erases the element `list[pos]`.
+-- `#list + 1`.
--
-- The default value for `pos` is `#list`, so that a call `table.remove(l)`
--- removes the last element of list `l`.
+-- removes the last element of the list `l`.
function table.remove(list [, pos]) end
---
--- Sorts list elements in a given order, *in-place*, from `list[1]` to
+-- Sorts the list elements in a given order, *in-place*, from `list[1]` to
-- `list[#list]`. If `comp` is given, then it must be a function that receives
-- two list elements and returns true when the first element must come before
-- the second in the final order (so that, after the sort, `i < j` implies
@@ -895,7 +983,7 @@ function table.unpack(list [, i [, j]]) end
-- @class table
-- @name math
-- @field huge (number)
--- The float value `HUGE_VAL`, a value larger than any other numerical value.
+-- The float value `HUGE_VAL`, a value greater than any other numerical value.
-- @field maxinteger (number)
-- An integer with the maximum value for an integer.
--
@@ -909,7 +997,7 @@ function table.unpack(list [, i [, j]]) end
local math
---
--- Returns the absolute value of `x`. (integer/float)
+-- Returns the maximum value between `x` and `-x`. (integer/float)
function math.abs(x) end
---
@@ -922,8 +1010,8 @@ function math.asin(x) end
---
-- Returns the arc tangent of `y/x` (in radians), but uses the signs
--- of both parameters to find the quadrant of the result. (It also handles
--- correctly the case of `x` being zero.)
+-- of both parameters to find the quadrant of the result. It also handles
+-- correctly the case of `x` being zero.
--
-- The default value for `x` is 1, so that the call `math.atan(y)` returns the
-- arc tangent of `y`.
@@ -938,7 +1026,7 @@ function math.atan(y [, x]) end
function math.atan2(y, x) end
---
--- Returns the smallest integral value larger than or equal to `x`.
+-- Returns the smallest integral value greater than or equal to `x`.
function math.ceil(x) end
---
@@ -960,7 +1048,7 @@ function math.deg(x) end
function math.exp(x) end
---
--- Returns the largest integral value smaller than or equal to `x`.
+-- Returns the largest integral value less than or equal to `x`.
function math.floor(x) end
---
@@ -994,12 +1082,12 @@ function math.log10(x) end
---
-- Returns the argument with the maximum value, according to the Lua operator
--- `<`. (integer/float)
+-- `<`.
function math.max(x, ···) end
---
-- Returns the argument with the minimum value, according to the Lua operator
--- `<`. (integer/float)
+-- `<`.
function math.min(x, ···) end
---
@@ -1022,17 +1110,35 @@ function math.rad(x) end
-- When called without arguments, returns a pseudo-random float with uniform
-- distribution in the range [0,1). When called with two integers `m` and `n`,
-- `math.random` returns a pseudo-random integer with uniform distribution in
--- the range `[m, n]. (The value `n-m` cannot be negative and must fit in a Lua
--- integer.) The call `math.random(n)` is equivalent to `math.random(1, n)`.
+-- the range `[m, n]. The call `math.random(n)`, for a positive `n`, is
+-- equivalent to `math.random(1,n)`. The call `math.random(0)` produces an
+-- integer with all bits (pseudo)random.
+--
+-- This function uses the `xoshiro256**` algorithm to produce pseudo-random
+-- 64-bit integers, which are the results of calls with argument 0. Other
+-- results (ranges and floats) are unbiased extracted from these integers.
--
--- This function is an interface to the underling pseudo-random generator
--- function provided by C.
+-- Lua initializes its pseudo-random generator with the equivalent of a call to
+-- `math.randomseed` with no arguments, so that `math.random` should generate
+-- different sequences of results each time the program runs.
function math.random([m [, n]]) end
---
--- Sets `x` as the "seed" for the pseudo-random generator: equal seeds
--- produce equal sequences of numbers.
-function math.randomseed(x) end
+-- When called with at least one argument, the integer parameters `x` and `y`
+-- are joined into a 128-bit *seed* that is used to reinitialize the
+-- pseudo-random generator; equal seeds produce equal sequences of numbers. The
+-- default for `y` is zero.
+--
+-- When called with no arguments, Lua generates a seed with a weak attempt for
+-- randomness.
+--
+-- This function returns the two seed components that were effectively used, so
+-- that setting them again repeats the sequence.
+--
+-- To ensure a required level of randomness to the initial state (or contrarily,
+-- to have a deterministic sequence, for instance when debugging a program), you
+-- should call `math.randomseed` with explicit arguments.
+function math.randomseed([x [, y]]) end
---
-- Returns the sine of `x` (assumed to be in radians).
@@ -1246,15 +1352,18 @@ function io.input([file]) end
---
-- Opens the given file name in read mode and returns an iterator function that
-- works like `file:lines(···)` over the opened file. When the iterator function
--- detects -- the end of file, it returns no values (to finish the loop) and
--- automatically closes the file.
+-- fails to read any value, it automatically closes the file. Besides the
+-- iterator function, `io.lines` returns three other values: two nil values as
+-- placeholders, plus the created file handle. Therefore, when used in a generic
+-- for loop, the file is closed also if the loop is interrupted by an error or a
+-- `break`.
--
-- The call `io.lines()` (with no file name) is equivalent to
-- `io.input():lines("l")`; that is, it iterates over the lines of the default
-- input file. In this case it does not close the file when the loop ends.
--
--- In case of errors this function raises the error, instead of returning an
--- error code.
+-- In case of errors opening the file, this function raises the error, instead
+-- of returning an error code.
function io.lines([filename, ···]) end
---
@@ -1279,7 +1388,7 @@ function io.open(filename [, mode]) end
function io.output([file]) end
---
--- Starts program `prog` in a separated process and returns a file handle
+-- Starts the 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"`).
--
@@ -1328,9 +1437,6 @@ function file:flush() end
-- will iterate over all characters of the file, starting at the current
-- position. Unlike `io.lines`, this function does not close the file when the
-- loop ends.
---
--- In case of errors this function raises the error, instead of returning an
--- error code.
function file:lines(···) end
---
@@ -1338,18 +1444,19 @@ function file:lines(···) end
-- what to read. For each format, the function returns a string or a number
-- with the characters read, or nil if it cannot read data with the specified
-- format. (In this latter case, the function does not read subsequent formats.)
--- When called without formats, it uses a default format that reads the next
+-- When called without arguments, it uses a default format that reads the next
-- line (see below).
--
-- The available formats are
-- "n": reads a numeral and returns it as a float or an integer, following the
--- lexical conventions of Lua. (The numeral may have leading spaces and a
--- sign.) This format always reads the longest input sequence that is a
--- valid prefix for a number; if that prefix does not form a valid number
--- (e.g., an empty string, "0x", or "3.4e-"), it is discarded and the
--- function returns nil.
+-- lexical conventions of Lua. (The numeral may have leading whitespaces
+-- and a sign.) This format always reads the longest input sequence that
+-- is a valid prefix for a number; if that prefix does not form a valid
+-- number (e.g., an empty string, "0x", or "3.4e-") or it is too long
+-- (more than 200 characters), it is discarded and the format returns
+-- nil.
-- "a": reads the whole file, starting at the current position. On end of
--- file, it returns the empty string.
+-- file, it returns the empty string; this format never fails.
-- "l": reads the next line skipping the end of line, returning nil on
-- end of file. This is the default format.
-- "L": reads the next line keeping the end-of-line character (if present),
@@ -1381,18 +1488,16 @@ function file:read(···) end
function file:seek([whence [, offset]]) end
---
--- Sets the buffering mode for an output file. There are three available
--- modes:
--- "no": no buffering; the result of any output operation appears immediately.
--- "full": full buffering; output operation is performed only when the
--- buffer is full or when you explicitly `flush` the file (see
--- `io.flush`).
--- "line": line buffering; output is buffered until a newline is output or
--- there is any input from some special files (such as a terminal
--- device).
+-- Sets the buffering mode for a file. There are three available modes:
+-- "no": no buffering
+-- "full": full buffering
+-- "line": line buffering
--
--- For the last two cases, `size` specifies the size of the buffer, in
+-- For the last two cases, `size` is a hint for the size of the buffer, in
-- bytes. The default is an appropriate size.
+--
+-- The specific behavior of each mode is non portable; check the underlying
+-- ISO C function `setvbuf` in your platform for more details.
function file:setvbuf(mode [, size]) end
---
@@ -1405,7 +1510,7 @@ function file:write(···) end
---
-- Returns an approximation of the amount in seconds of CPU time used by
--- the program.
+-- the program, as returned by the underlying ISO C function `clock`.
function os.clock() end
---
@@ -1419,17 +1524,16 @@ function os.clock() end
-- If `format` starts with '`!`', then the date is formatted in Coordinated
-- Universal Time. After this optional character, if `format` is the string
-- "`*t`", then `date` returns a table with the following fields: `year`,
--- `month` (1-12), `day` (1-31), `hour` (0-23), `min` (0-59), `sec` (0-61),
--- `wday` (weekday, 1-7, Sunday is 1), `yday` (day of the year, 1-366), and
--- `isdst` (daylight saving flag, a boolean). This last field may be absent if
--- the information is not available.
+-- `month` (1-12), `day` (1-31), `hour` (0-23), `min` (0-59), `sec` (0-61, due
+-- to leap seconds), `wday` (weekday, 1-7, Sunday is 1), `yday` (day of the
+-- year, 1-366), and `isdst` (daylight saving flag, a boolean). This last field
+-- may be absent if the information is not available.
--
-- If `format` is not "`*t`", then `date` returns the date as a string,
-- formatted according to the same rules as the ISO C function `strftime`.
--
--- When called without arguments, `date` returns a reasonable date and time
--- representation that depends on the host system and on the current locale.
--- (More specifically, `os.date()` is equivalent to `os.date("%c")`.)
+-- If `format` is absent, it defaults to "`%c`", which gives a human-readable
+-- date and time representation using the current locale.
--
-- On non-POSIX systems, this function may be not thread safe because of its
-- reliance on C function `gmtime` and C function `localtime`.
@@ -1507,11 +1611,20 @@ function os.setlocale(locale [, category]) end
-- (default is nil). For a description of these fields, see the `os.date`
-- function.
--
+-- When the function is called, the values in these fields do not need to be
+-- inside their valid ranges. For instance, if `sec` is -10, it means 10 seconds
+-- before the time specified by the other fields; if `hour` is 1000, it means
+-- 1000 hours after the time specified by the other fields.
+--
-- The returned value is a number, whose meaning depends on your system. In
-- POSIX, Windows, and some other systems, this number counts the number of
-- seconds since some given start time (the "epoch"). In other systems, the
-- meaning is not specified, and the number returned by `time` can be used only
-- as an argument to `os.date` and `os.difftime`.
+--
+-- When called with a table, `os.time` also normalizes all the fields documented
+-- in the `os.date` function, so that they represent the same time as before the
+-- call but with values inside their valid ranges.
function os.time([table]) end
---
@@ -1547,8 +1660,10 @@ function debug.getfenv(o) end
---
-- Returns the current hook settings of the thread, as three values: the
--- current hook function, the current hook mask, and the current hook count
--- (as set by the `debug.sethook` function).
+-- current hook function, the current hook mask, and the current hook count,
+-- as set by the `debug.sethook` function.
+--
+-- Returns nil if there is no active hook.
function debug.gethook([thread]) end
---
@@ -1556,8 +1671,9 @@ function debug.gethook([thread]) end
-- function directly or you can give a number as the value of `f`, which means
-- the function running at level `f` of the call stack of the given thread:
-- level 0 is the current function (`getinfo` itself); level 1 is the function
--- that called `getinfo` and so on. If `f` is a number larger than the number of
--- active functions, then `getinfo` returns nil.
+-- that called `getinfo` (except for tail calls, which do not count in the
+-- stack); and so on. If `f` is a number greater than the number of active
+-- functions, then `getinfo` returns nil.
--
-- The returned table can contain all the fields returned by `lua_getinfo`,
-- with the string `what` describing which fields to fill in. The default for
@@ -1575,15 +1691,16 @@ function debug.getinfo([thread,] f [, what]) end
---
-- This function returns the name and the value of the local variable with index
-- `local` of the function at level `f` of the stack. This function accesses not
--- only explicit local variables, but also parameters, temporaries, etc.
+-- only explicit local variables, but also parameters and temporary values.
--
-- The first parameter or local variable has index 1, and so on, following the
-- order that they are declared in the code, counting only the variables that
--- are active in the current scope of the function. Negative indices refer to
--- vararg parameters; -1 is the first vararg parameter. The function returns nil
--- if there is no variable with the given index, and raises an error when called
--- with a level out of range. (You can call `debug.getinfo` to check whether the
--- level is valid.)
+-- are active in the current scope of the function. Compile-time constants may
+-- not appear in this listing, if they were optimized away by the compiler.
+-- Negative indices refer to vararg parameters; -1 is the first vararg
+-- parameter. The function returns nil if there is no variable with the given
+-- index, and raises an error when called with a level out of range. (You can
+-- call `debug.getinfo` to check whether the level is valid.)
--
-- Variable names starting with '(' (open parenthesis) represent variables with
-- no known names (internal variables such as loop control variables, and
@@ -1599,7 +1716,7 @@ function debug.getlocal([thread,] f, local) end
function debug.getmetatable(value) end
---
--- Returns the registry table (see §4.5).
+-- Returns the registry table (see §4.3).
function debug.getregistry() end
---
@@ -1607,16 +1724,22 @@ function debug.getregistry() end
-- `up` of the function `f`. The function returns nil if there is no upvalue
-- with the given index.
--
--- Variable names starting with '(' (open parenthesis) represent variables with
--- no known names (variables from chunks saved without debug information).
+-- (For Lua functions, upvalues are the external local variables that the
+-- function uses, and that are consequently included in its closure.)
+--
+-- For C functions, this function uses the empty string `""` as a name for all
+-- upvalues.
+--
+-- Variable name '`?`' (interrogation mark) represents variables with no known
+-- names (variables from chunks saved without debug information).
function debug.getupvalue(f, up) end
---
--- Returns the Lua value associated to `u`. If `u` is not a userdata, returns
--- nil.
+-- Returns the `n`-th user value associated to the userdata `u` plus a boolean,
+-- false, if the userdata does not have that value.
--
-- New in Lua 5.2.
-function debug.getuservalue(u) end
+function debug.getuservalue(u, n) end
---
-- Sets the environment of the given `object` to the given `table`. Returns
@@ -1626,7 +1749,7 @@ function debug.getuservalue(u) end
function debug.setfenv(object, table) end
---
--- Sets the given function as a hook. The string `mask` and the number
+-- Sets the given function as the debug hook. The string `mask` and the number
-- `count` describe when the hook will be called. The string mask may have any
-- combination of the following characters, with the given meaning:
-- "c": the hook is called every time Lua calls a function;
@@ -1639,11 +1762,11 @@ function debug.setfenv(object, table) end
-- When called without arguments, `debug.sethook` turns off the hook.
--
-- When the hook is called, its first parameter is a string describing
--- the event that has triggered its call: `"call"` (or `"tail call"`),
--- `"return"`, `"line"`, and `"count"`. For line events, the hook also gets the
--- new line number as its second parameter. Inside a hook, you can call
--- `getinfo` with level 2 to get more information about the running function
--- (level 0 is the `getinfo` function, and level 1 is the hook function).
+-- the event that has triggered its call: `"call"`, `"tail call"`, `"return"`,
+-- `"line"`, and `"count"`. For line events, the hook also gets the new line
+-- number as its second parameter. Inside a hook, you can call `getinfo` with
+-- level 2 to get more information about the running function. (Level 0 is the
+-- `getinfo` function, and level 1 is the hook function.)
function debug.sethook([thread,] hook, mask [, count]) end
---
@@ -1666,16 +1789,18 @@ function debug.setmetatable(value, table) end
-- This function assigns the value `value` to the upvalue with index `up`
-- of the function `f`. The function returns nil if there is no upvalue with the
-- given index. Otherwise, it returns the name of the upvalue.
+--
+-- See `debug.getupvalue` for more information about upvalues.
function debug.setupvalue(f, up, value) end
---
--- Sets the given `value` as the Lua value associated to the given `udata`.
--- `udata` must be a full userdata.
+-- Sets the given `value` as the `n`-th user value associated to the given
+-- `udata`. `udata` must be a full userdata.
--
--- Returns `udata`.
+-- Returns `udata`, or nil if the userdata does not have that value.
--
-- New in Lua 5.2.
-function debug.setuservalue(udata, value) end
+function debug.setuservalue(udata, value, n) end
---
-- If `message` is present but is neither a string nor nil, this function
diff --git a/modules/lua/ta_tags b/modules/lua/ta_tags
index c9165567..3ba2dd81 100644
--- a/modules/lua/ta_tags
+++ b/modules/lua/ta_tags
@@ -439,9 +439,9 @@ colors _HOME/lexers/lexer.lua /^M.colors = setmetatable({}, {$/;" t class:lexer
colorselect _HOME/core/.ui.dialogs.luadoc /^function colorselect(options) end$/;" f class:ui.dialogs
column _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:buffer
command_entry _HOME/modules/textadept/command_entry.lua /^module('ui.command_entry')]]$/;" m class:ui
-comment_string _HOME/modules/textadept/editing.lua /^M.comment_string = {actionscript='//',ada='--',apdl='!',ansi_c='/*|*/',antlr='//',apl='#',applescript='--',asp='\'',autoit=';',awk='#',b_lang='//',bash='#',batch=':',bibtex='%',boo='#',chuck='//',clojure=';',cmake='#',coffeescript='#',context='%',cpp='//',crystal='#',csharp='//',css='/*|*/',cuda='//',desktop='#',django='{#|#}',dmd='//',dockerfile='#',dot='//',eiffel='--',elixir='#',elm='--',erlang='%',fantom='//',faust='//',fennel=';',fish='#',forth='|\\',fortran='!',fsharp='//',fstab='#',gap='#',gettext='#',gherkin='#',glsl='//',gnuplot='#',go='//',groovy='//',gtkrc='#',haskell='--',html='<!--|-->',icon='#',idl='//',inform='!',ini='#',Io='#',java='//',javascript='//',jq='#',json='/*|*/',jsp='//',julia='#',latex='%',ledger='#',less='//',lilypond='%',lisp=';',logtalk='%',lua='--',makefile='#',matlab='#',meson='#',moonscript='--',myrddin='//',nemerle='//',networkd='#',nim='#',nsis='#',objective_c='//',pascal='//',perl='#',php='//',pico8='//',pike='//',pkgbuild='#',pony='//',prolog='%',props='#',protobuf='//',ps='%',pure='//',python='#',rails='#',rc='#',reason='//',rebol=';',rest='.. ',rexx='--',rhtml='<!--|-->',routeros='#',rstats='#',ruby='#',rust='//',sass='//',scala='//',scheme=';',smalltalk='"|"',sml='(*)',snobol4='#',spin="'",sql='--',systemd='#',tcl='#',tex='%',text='',toml='#',vala='//',vb='\'',vbscript='\'',verilog='//',vhdl='--',wsf='<!--|-->',xml='<!--|-->',xs='#',xtend='//',yaml='#',zig='//'}$/;" t class:textadept.editing
+comment_string _HOME/modules/textadept/editing.lua /^M.comment_string = {actionscript='//',ada='--',apdl='!',ansi_c='/*|*/',antlr='//',apl='#',applescript='--',asp='\'',autoit=';',awk='#',b_lang='//',bash='#',batch=':',bibtex='%',boo='#',chuck='//',clojure=';',cmake='#',coffeescript='#',context='%',cpp='//',crystal='#',csharp='//',css='/*|*/',cuda='//',desktop='#',django='{#|#}',dmd='//',dockerfile='#',dot='//',eiffel='--',elixir='#',elm='--',erlang='%',fantom='//',faust='//',fennel=';',fish='#',forth='|\\',fortran='!',fsharp='//',fstab='#',gap='#',gettext='#',gherkin='#',glsl='//',gnuplot='#',go='//',groovy='//',gtkrc='#',haskell='--',html='<!--|-->',icon='#',idl='//',inform='!',ini='#',Io='#',java='//',javascript='//',jq='#',json='/*|*/',jsp='//',julia='#',latex='%',ledger='#',less='//',lilypond='%',lisp=';',logtalk='%',lua='--',makefile='#',matlab='#',meson='#',moonscript='--',myrddin='//',nemerle='//',networkd='#',nim='#',nsis='#',objective_c='//',pascal='//',perl='#',php='//',pico8='//',pike='//',pkgbuild='#',pony='//',prolog='%',props='#',protobuf='//',ps='%',pure='//',python='#',rails='#',rc='#',reason='//',rebol=';',rest='.. ',rexx='--',rhtml='<!--|-->',routeros='#',rstats='#',ruby='#',rust='//',sass='//',scala='//',scheme=';',smalltalk='"|"',sml='(*)',snobol4='#',spin="'",sql='--',systemd='#',tcl='#',tex='%',text='',toml='#',typescript='//',vala='//',vb='\'',vbscript='\'',verilog='//',vhdl='--',wsf='<!--|-->',xml='<!--|-->',xs='#',xtend='//',yaml='#',zig='//'}$/;" t class:textadept.editing
compile _HOME/modules/textadept/run.lua /^function M.compile(filename)$/;" f class:textadept.run
-compile_commands _HOME/modules/textadept/run.lua /^M.compile_commands = {actionscript='mxmlc "%f"',ada='gnatmake "%f"',ansi_c='gcc -o "%e" "%f"',antlr='antlr4 "%f"',g='antlr3 "%f"',applescript='osacompile "%f" -o "%e.scpt"',asm='nasm "%f"'--[[ && ld "%e.o" -o "%e"']],boo='booc "%f"',caml='ocamlc -o "%e" "%f"',csharp=WIN32 and 'csc "%f"' or 'mcs "%f"',coffeescript='coffee -c "%f"',context='context --nonstopmode "%f"',cpp='g++ -o "%e" "%f"',cuda=WIN32 and 'nvcc -o "%e.exe" "%f"' or 'nvcc -o "%e" "%f"',dmd='dmd "%f"',dot='dot -Tps "%f" -o "%e.ps"',eiffel='se c "%f"',elixir='elixirc "%f"',erlang='erl -compile "%e"',faust='faust -o "%e.cpp" "%f"',fsharp=WIN32 and 'fsc.exe "%f"' or 'mono fsc.exe "%f"',fortran='gfortran -o "%e" "%f"',gap='gac -o "%e" "%f"',go='go build "%f"',groovy='groovyc "%f"',haskell=WIN32 and 'ghc -o "%e.exe" "%f"' or 'ghc -o "%e" "%f"',inform=function() return 'inform -c "'..buffer.filename:match('^(.+%.inform[/\\])Source')..'"' end,java='javac "%f"',ltx='pdflatex -file-line-error -halt-on-error "%f"',less='lessc --no-color "%f" "%e.css"',lilypond='lilypond "%f"',lisp='clisp -c "%f"',litcoffee='coffee -c "%f"',lua='luac -o "%e.luac" "%f"',moon='moonc "%f"',markdown='markdown "%f" > "%e.html"',myr='mbld -b "%e" "%f"',nemerle='ncc "%f" -out:"%e.exe"',nim='nim c "%f"',nsis='MakeNSIS "%f"',objective_c='gcc -o "%e" "%f"',pascal='fpc "%f"',perl='perl -c "%f"',php='php -l "%f"',pony='ponyc "%f"',prolog='gplc --no-top-level "%f"',python='python -m py_compile "%f"',ruby='ruby -c "%f"',rust='rustc "%f"',sass='sass "%f" "%e.css"',scala='scalac "%f"',sml='mlton "%f"',tex='pdflatex -file-line-error -halt-on-error "%f"',vala='valac "%f"',vb=WIN32 and 'vbc "%f"' or 'vbnc "%f"',zig='zig build-exe "%f"'}$/;" t class:textadept.run
+compile_commands _HOME/modules/textadept/run.lua /^M.compile_commands = {actionscript='mxmlc "%f"',ada='gnatmake "%f"',ansi_c='gcc -o "%e" "%f"',antlr='antlr4 "%f"',g='antlr3 "%f"',applescript='osacompile "%f" -o "%e.scpt"',asm='nasm "%f"'--[[ && ld "%e.o" -o "%e"']],boo='booc "%f"',caml='ocamlc -o "%e" "%f"',csharp=WIN32 and 'csc "%f"' or 'mcs "%f"',coffeescript='coffee -c "%f"',context='context --nonstopmode "%f"',cpp='g++ -o "%e" "%f"',cuda=WIN32 and 'nvcc -o "%e.exe" "%f"' or 'nvcc -o "%e" "%f"',dmd='dmd "%f"',dot='dot -Tps "%f" -o "%e.ps"',eiffel='se c "%f"',elixir='elixirc "%f"',erlang='erl -compile "%e"',faust='faust -o "%e.cpp" "%f"',fsharp=WIN32 and 'fsc.exe "%f"' or 'mono fsc.exe "%f"',fortran='gfortran -o "%e" "%f"',gap='gac -o "%e" "%f"',go='go build "%f"',groovy='groovyc "%f"',haskell=WIN32 and 'ghc -o "%e.exe" "%f"' or 'ghc -o "%e" "%f"',inform=function() return 'inform -c "'..buffer.filename:match('^(.+%.inform[/\\])Source')..'"' end,java='javac "%f"',ltx='pdflatex -file-line-error -halt-on-error "%f"',less='lessc --no-color "%f" "%e.css"',lilypond='lilypond "%f"',lisp='clisp -c "%f"',litcoffee='coffee -c "%f"',lua='luac -o "%e.luac" "%f"',moon='moonc "%f"',markdown='markdown "%f" > "%e.html"',myr='mbld -b "%e" "%f"',nemerle='ncc "%f" -out:"%e.exe"',nim='nim c "%f"',nsis='MakeNSIS "%f"',objective_c='gcc -o "%e" "%f"',pascal='fpc "%f"',perl='perl -c "%f"',php='php -l "%f"',pony='ponyc "%f"',prolog='gplc --no-top-level "%f"',python='python -m py_compile "%f"',ruby='ruby -c "%f"',rust='rustc "%f"',sass='sass "%f" "%e.css"',scala='scalac "%f"',sml='mlton "%f"',tex='pdflatex -file-line-error -halt-on-error "%f"',typescript='tsc "%f"',vala='valac "%f"',vb=WIN32 and 'vbc "%f"' or 'vbnc "%f"',zig='zig build-exe "%f"'}$/;" t class:textadept.run
connect _HOME/core/events.lua /^function M.connect(event, f, index)$/;" f class:events
constants _HOME/core/iface.lua /^M.constants = {ACCESSIBILITY_DISABLED=0,ACCESSIBILITY_ENABLED=1,ALPHA_NOALPHA=256,ALPHA_OPAQUE=255,ALPHA_TRANSPARENT=0,ANNOTATION_BOXED=2,ANNOTATION_HIDDEN=0,ANNOTATION_INDENTED=3,ANNOTATION_STANDARD=1,AUTOMATICFOLD_CHANGE=0x0004,AUTOMATICFOLD_CLICK=0x0002,AUTOMATICFOLD_SHOW=0x0001,CARETSTICKY_OFF=0,CARETSTICKY_ON=1,CARETSTICKY_WHITESPACE=2,CARETSTYLE_BLOCK=2,CARETSTYLE_BLOCK_AFTER=0x100,CARETSTYLE_INS_MASK=0xF,CARETSTYLE_INVISIBLE=0,CARETSTYLE_LINE=1,CARETSTYLE_OVERSTRIKE_BAR=0,CARETSTYLE_OVERSTRIKE_BLOCK=0x10,CARET_EVEN=0x08,CARET_JUMPS=0x10,CARET_SLOP=0x01,CARET_STRICT=0x04,CASEINSENSITIVEBEHAVIOR_IGNORECASE=1,CASEINSENSITIVEBEHAVIOR_RESPECTCASE=0,CASE_CAMEL=3,CASE_LOWER=2,CASE_MIXED=0,CASE_UPPER=1,CHARACTERSOURCE_DIRECT_INPUT=0,CHARACTERSOURCE_IME_RESULT=2,CHARACTERSOURCE_TENTATIVE_INPUT=1,CP_UTF8=65001,CURSORARROW=2,CURSORNORMAL=-1,CURSORREVERSEARROW=7,CURSORWAIT=4,EDGE_BACKGROUND=2,EDGE_LINE=1,EDGE_MULTILINE=3,EDGE_NONE=0,EOLANNOTATION_BOXED=2,EOLANNOTATION_HIDDEN=0,EOLANNOTATION_STANDARD=1,EOL_CR=1,EOL_CRLF=0,EOL_LF=2,FIND_CXX11REGEX=0x00800000,FIND_MATCHCASE=0x4,FIND_NONE=0x0,FIND_REGEXP=10485760,FIND_WHOLEWORD=0x2,FIND_WORDSTART=0x00100000,FOLDACTION_CONTRACT=0,FOLDACTION_EXPAND=1,FOLDACTION_TOGGLE=2,FOLDDISPLAYTEXT_BOXED=2,FOLDDISPLAYTEXT_HIDDEN=0,FOLDDISPLAYTEXT_STANDARD=1,FOLDFLAG_LEVELNUMBERS=0x0040,FOLDFLAG_LINEAFTER_CONTRACTED=0x0010,FOLDFLAG_LINEAFTER_EXPANDED=0x0008,FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004,FOLDFLAG_LINEBEFORE_EXPANDED=0x0002,FOLDFLAG_LINESTATE=0x0080,FOLDLEVELBASE=0x400,FOLDLEVELHEADERFLAG=0x2000,FOLDLEVELNUMBERMASK=0x0FFF,FOLDLEVELWHITEFLAG=0x1000,IDLESTYLING_AFTERVISIBLE=2,IDLESTYLING_ALL=3,IDLESTYLING_NONE=0,IDLESTYLING_TOVISIBLE=1,IME_INLINE=1,IME_WINDOWED=0,INDICATOR_CONTAINER=9,INDICATOR_IME=33,INDICATOR_IME_MAX=36,INDICATOR_MAX=36,INDIC_BOX=6,INDIC_COMPOSITIONTHICK=14,INDIC_COMPOSITIONTHIN=15,INDIC_CONTAINER=8,INDIC_DASH=9,INDIC_DIAGONAL=3,INDIC_DOTBOX=12,INDIC_DOTS=10,INDIC_FULLBOX=16,INDIC_GRADIENT=20,INDIC_GRADIENTCENTER=21,INDIC_HIDDEN=5,INDIC_IME=32,INDIC_IME_MAX=35,INDIC_MAX=35,INDIC_PLAIN=0,INDIC_POINT=18,INDIC_POINTCHARACTER=19,INDIC_ROUNDBOX=7,INDIC_SQUIGGLE=1,INDIC_SQUIGGLELOW=11,INDIC_SQUIGGLEPIXMAP=13,INDIC_STRAIGHTBOX=8,INDIC_STRIKE=4,INDIC_TEXTFORE=17,INDIC_TT=2,IV_LOOKBOTH=3,IV_LOOKFORWARD=2,IV_NONE=0,IV_REAL=1,LASTSTEPINUNDOREDO=0x100,MARGINOPTION_NONE=0,MARGINOPTION_SUBLINESELECT=1,MARGIN_BACK=2,MARGIN_COLOR=6,MARGIN_FORE=3,MARGIN_NUMBER=1,MARGIN_RTEXT=5,MARGIN_SYMBOL=0,MARGIN_TEXT=4,MARKER_MAX=32,MARKNUM_FOLDER=31,MARKNUM_FOLDEREND=26,MARKNUM_FOLDERMIDTAIL=28,MARKNUM_FOLDEROPEN=32,MARKNUM_FOLDEROPENMID=27,MARKNUM_FOLDERSUB=30,MARKNUM_FOLDERTAIL=29,MARK_ARROW=2,MARK_ARROWDOWN=6,MARK_ARROWS=24,MARK_AVAILABLE=28,MARK_BACKGROUND=22,MARK_BOOKMARK=31,MARK_BOXMINUS=14,MARK_BOXMINUSCONNECTED=15,MARK_BOXPLUS=12,MARK_BOXPLUSCONNECTED=13,MARK_CHARACTER=10000,MARK_CIRCLE=0,MARK_CIRCLEMINUS=20,MARK_CIRCLEMINUSCONNECTED=21,MARK_CIRCLEPLUS=18,MARK_CIRCLEPLUSCONNECTED=19,MARK_DOTDOTDOT=23,MARK_EMPTY=5,MARK_FULLRECT=26,MARK_LCORNER=10,MARK_LCORNERCURVE=16,MARK_LEFTRECT=27,MARK_MINUS=7,MARK_PIXMAP=25,MARK_PLUS=8,MARK_RGBAIMAGE=30,MARK_ROUNDRECT=1,MARK_SHORTARROW=4,MARK_SMALLRECT=3,MARK_TCORNER=11,MARK_TCORNERCURVE=17,MARK_UNDERLINE=29,MARK_VERTICALBOOKMARK=32,MARK_VLINE=9,MASK_FOLDERS=0xFE000000,MAX_MARGIN=5,MODEVENTMASKALL=0x7FFFFF,MOD_ALT=4,MOD_BEFOREDELETE=0x800,MOD_BEFOREINSERT=0x400,MOD_CHANGEANNOTATION=0x20000,MOD_CHANGEEOLANNOTATION=0x400000,MOD_CHANGEFOLD=0x8,MOD_CHANGEINDICATOR=0x4000,MOD_CHANGELINESTATE=0x8000,MOD_CHANGEMARGIN=0x10000,MOD_CHANGEMARKER=0x200,MOD_CHANGESTYLE=0x4,MOD_CHANGETABSTOPS=0x200000,MOD_CONTAINER=0x40000,MOD_CTRL=2,MOD_DELETETEXT=0x2,MOD_INSERTCHECK=0x100000,MOD_INSERTTEXT=0x1,MOD_LEXERSTATE=0x80000,MOD_META=16,MOD_NONE=0x0,MOD_NORM=0,MOD_SHIFT=1,MOD_SUPER=8,MOUSE_DRAG=2,MOUSE_PRESS=1,MOUSE_RELEASE=3,MULTIAUTOC_EACH=1,MULTIAUTOC_ONCE=0,MULTILINEUNDOREDO=0x1000,MULTIPASTE_EACH=1,MULTIPASTE_ONCE=0,MULTISTEPUNDOREDO=0x80,ORDER_CUSTOM=2,ORDER_PERFORMSORT=1,ORDER_PRESORTED=0,PERFORMED_REDO=0x40,PERFORMED_UNDO=0x20,PERFORMED_USER=0x10,SEL_LINES=2,SEL_RECTANGLE=1,SEL_STREAM=0,SEL_THIN=3,STARTACTION=0x2000,STYLE_BRACEBAD=36,STYLE_BRACELIGHT=35,STYLE_CALLTIP=39,STYLE_CONTROLCHAR=37,STYLE_DEFAULT=33,STYLE_FOLDDISPLAYTEXT=40,STYLE_INDENTGUIDE=38,STYLE_LASTPREDEFINED=40,STYLE_LINENUMBER=34,STYLE_MAX=256,TD_LONGARROW=0,TD_STRIKEOUT=1,TIME_FOREVER=10000000,UNDO_NONE=0,UPDATE_CONTENT=0x1,UPDATE_H_SCROLL=0x8,UPDATE_SELECTION=0x2,UPDATE_V_SCROLL=0x4,VISIBLE_SLOP=0x01,VISIBLE_STRICT=0x04,VS_NONE=0,VS_NOWRAPLINESTART=4,VS_RECTANGULARSELECTION=1,VS_USERACCESSIBLE=2,WRAPINDENT_DEEPINDENT=3,WRAPINDENT_FIXED=0,WRAPINDENT_INDENT=2,WRAPINDENT_SAME=1,WRAPVISUALFLAGLOC_DEFAULT=0x0000,WRAPVISUALFLAGLOC_END_BY_TEXT=0x0001,WRAPVISUALFLAGLOC_START_BY_TEXT=0x0002,WRAPVISUALFLAG_END=0x0001,WRAPVISUALFLAG_MARGIN=0x0004,WRAPVISUALFLAG_NONE=0x0000,WRAPVISUALFLAG_START=0x0002,WRAP_CHAR=2,WRAP_NONE=0,WRAP_WHITESPACE=3,WRAP_WORD=1,WS_INVISIBLE=0,WS_VISIBLEAFTERINDENT=2,WS_VISIBLEALWAYS=1,WS_VISIBLEONLYININDENT=3}$/;" t class:_SCINTILLA
context_menu _HOME/core/ui.lua /^module('ui')]]$/;" F class:ui
@@ -500,12 +500,12 @@ eol_annotation_style _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:bu
eol_annotation_text _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:buffer
eol_annotation_visible _HOME/core/.view.luadoc /^module('view')$/;" F class:view
eol_mode _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:buffer
-error_patterns _HOME/modules/textadept/run.lua /^M.error_patterns = {actionscript={'^(.-)%((%d+)%): col: (%d+) (.+)$'},ada={'^(.-):(%d+):(%d+):%s*(.*)$','^[^:]+: (.-):(%d+) (.+)$'},ansi_c={'^(.-):(%d+):(%d+): (.+)$'},antlr={'^error%(%d+%): (.-):(%d+):(%d+): (.+)$','^warning%(%d+%): (.-):(%d+):(%d+): (.+)$'},--[[ANTLR]]g={'^error%(%d+%): (.-):(%d+):(%d+): (.+)$','^warning%(%d+%): (.-):(%d+):(%d+): (.+)$'},asm={'^(.-):(%d+): (.+)$'},awk={'^awk: (.-):(%d+): (.+)$'},boo={'^(.-)%((%d+),(%d+)%): (.+)$'},caml={'^%s*File "(.-)", line (%d+), characters (%d+)'},chuck={'^(.-)line%((%d+)%)%.char%((%d+)%): (.+)$'},clojure={' error .- at .-%((.-):(%d+)'},cmake={'^CMake Error at (.-):(%d+)','^(.-):(%d+):$'},coffeescript={'^(.-):(%d+):(%d+): (.+)$'},context={'error on line (%d+) in file (.-): (.+)$'},cpp={'^(.-):(%d+):(%d+): (.+)$'},csharp={'^(.-)%((%d+),(%d+)%): (.+)$'},cuda={'^(.-)%((%d+)%): (error.+)$'},dart={"^'(.-)': error: line (%d+) pos (%d+): (.+)$",'%(file://(.-):(%d+):(%d+)%)'},dmd={'^(.-)%((%d+)%): (Error.+)$'},dot={'^Warning: (.-): (.+) in line (%d+)'},eiffel={'^Line (%d+) columns? .- in .- %((.-)%):$','^line (%d+) column (%d+) file (.-)$'},elixir={'^(.-):(%d+): (.+)$','Error%) (.-):(%d+): (.+)$'},erlang={'^(.-):(%d+): (.+)$'},fantom={'^(.-)%((%d+),(%d+)%): (.+)$'},faust={'^(.-):(%d+):(.+)$'},fennel={'^%S+ error in (.-):(%d+)'},forth={'^(.-):(%d+): (.+)$'},fortran={'^(.-):(%d+)%D+(%d+):%s*(.*)$'},fsharp={'^(.-)%((%d+),(%d+)%): (.+)$'},gap={'^(.+) in (.-) line (%d+)$'},gnuplot={'^"(.-)", line (%d+): (.+)$'},go={'^(.-):(%d+):(%d+): (.+)$'},groovy={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},haskell={'^(.-):(%d+):(%d+):%s*(.*)$'},icon={'^File (.-); Line (%d+) # (.+)$','^.-from line (%d+) in (.-)$'},java={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},javascript={'^%s+at .-%((.-):(%d+):(%d+)%)$','^%s+at (.-):(%d+):(%d+)$','^(.-):(%d+):?$'},jq={'^jq: error: (.+) at (.-), line (%d+)'},julia={'^%s+%[%d+%].- at (.-):(%d+)$'},ltx={'^(.-):(%d+): (.+)$'},less={'^(.+) in (.-) on line (%d+), column (%d+):$'},lilypond={'^(.-):(%d+):(%d+):%s*(.*)$'},litcoffee={'^(.-):(%d+):(%d+): (.+)$'},lua={'^luac?: (.-):(%d+): (.+)$'},makefile={'^(.-):(%d+): (.+)$'},nemerle={'^(.-)%((%d+),(%d+)%): (.+)$'},nim={'^(.-)%((%d+), (%d+)%) (%w+:.+)$'},objective_c={'^(.-):(%d+):(%d+): (.+)$'},pascal={'^(.-)%((%d+),(%d+)%) (%w+:.+)$'},perl={'^(.+) at (.-) line (%d+)'},php={'^(.+) in (.-) on line (%d+)$'},pike={'^(.-):(%d+):(.+)$'},pony={'^(.-):(%d+):(%d+): (.+)$'},prolog={'^(.-):(%d+):(%d+): (.+)$','^(.-):(%d+): (.+)$'},pure={'^(.-), line (%d+): (.+)$'},python={'^%s*File "(.-)", line (%d+)'},rexx={'^Error %d+ running "(.-)", line (%d+): (.+)$'},ruby={'^%s+from (.-):(%d+):','^(.-):(%d+):%s*(.+)$'},rust={'^(.-):(%d+):(%d+): (.+)$',"panicked at '([^']+)', (.-):(%d+)"},sass={'^WARNING on line (%d+) of (.-):$','^%s+on line (%d+) of (.-)$'},scala={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},sh={'^(.-): (%d+): %1: (.+)$'},bash={'^(.-): line (%d+): (.+)$'},zsh={'^(.-):(%d+): (.+)$'},smalltalk={'^(.-):(%d+): (.+)$','%((.-):(%d+)%)$'},snobol4={'^(.-):(%d+): (.+)$'},tcl={'^%s*%(file "(.-)" line (%d+)%)$'},tex={'^(.-):(%d+): (.+)$'},vala={'^(.-):(%d+)%.(%d+)[%-%.%d]+: (.+)$','^(.-):(%d+):(%d+): (.+)$'},vb={'^(.-)%((%d+),(%d+)%): (.+)$'},xs={'^(.-):(%d+)%S* (.+)$'},zig={'^(.-):(%d+):(%d+): (.+)$'}}$/;" t class:textadept.run
+error_patterns _HOME/modules/textadept/run.lua /^M.error_patterns = {actionscript={'^(.-)%((%d+)%): col: (%d+) (.+)$'},ada={'^(.-):(%d+):(%d+):%s*(.*)$','^[^:]+: (.-):(%d+) (.+)$'},ansi_c={'^(.-):(%d+):(%d+): (.+)$'},antlr={'^error%(%d+%): (.-):(%d+):(%d+): (.+)$','^warning%(%d+%): (.-):(%d+):(%d+): (.+)$'},--[[ANTLR]]g={'^error%(%d+%): (.-):(%d+):(%d+): (.+)$','^warning%(%d+%): (.-):(%d+):(%d+): (.+)$'},asm={'^(.-):(%d+): (.+)$'},awk={'^awk: (.-):(%d+): (.+)$'},boo={'^(.-)%((%d+),(%d+)%): (.+)$'},caml={'^%s*File "(.-)", line (%d+), characters (%d+)'},chuck={'^(.-)line%((%d+)%)%.char%((%d+)%): (.+)$'},clojure={' error .- at .-%((.-):(%d+)'},cmake={'^CMake Error at (.-):(%d+)','^(.-):(%d+):$'},coffeescript={'^(.-):(%d+):(%d+): (.+)$'},context={'error on line (%d+) in file (.-): (.+)$'},cpp={'^(.-):(%d+):(%d+): (.+)$'},csharp={'^(.-)%((%d+),(%d+)%): (.+)$'},cuda={'^(.-)%((%d+)%): (error.+)$'},dart={"^'(.-)': error: line (%d+) pos (%d+): (.+)$",'%(file://(.-):(%d+):(%d+)%)'},dmd={'^(.-)%((%d+)%): (Error.+)$'},dot={'^Warning: (.-): (.+) in line (%d+)'},eiffel={'^Line (%d+) columns? .- in .- %((.-)%):$','^line (%d+) column (%d+) file (.-)$'},elixir={'^(.-):(%d+): (.+)$','Error%) (.-):(%d+): (.+)$'},erlang={'^(.-):(%d+): (.+)$'},fantom={'^(.-)%((%d+),(%d+)%): (.+)$'},faust={'^(.-):(%d+):(.+)$'},fennel={'^%S+ error in (.-):(%d+)'},forth={'^(.-):(%d+): (.+)$'},fortran={'^(.-):(%d+)%D+(%d+):%s*(.*)$'},fsharp={'^(.-)%((%d+),(%d+)%): (.+)$'},gap={'^(.+) in (.-) line (%d+)$'},gnuplot={'^"(.-)", line (%d+): (.+)$'},go={'^(.-):(%d+):(%d+): (.+)$'},groovy={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},haskell={'^(.-):(%d+):(%d+):%s*(.*)$'},icon={'^File (.-); Line (%d+) # (.+)$','^.-from line (%d+) in (.-)$'},java={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},javascript={'^%s+at .-%((.-):(%d+):(%d+)%)$','^%s+at (.-):(%d+):(%d+)$','^(.-):(%d+):?$'},jq={'^jq: error: (.+) at (.-), line (%d+)'},julia={'^%s+%[%d+%].- at (.-):(%d+)$'},ltx={'^(.-):(%d+): (.+)$'},less={'^(.+) in (.-) on line (%d+), column (%d+):$'},lilypond={'^(.-):(%d+):(%d+):%s*(.*)$'},litcoffee={'^(.-):(%d+):(%d+): (.+)$'},lua={'^luac?: (.-):(%d+): (.+)$'},makefile={'^(.-):(%d+): (.+)$'},nemerle={'^(.-)%((%d+),(%d+)%): (.+)$'},nim={'^(.-)%((%d+), (%d+)%) (%w+:.+)$'},objective_c={'^(.-):(%d+):(%d+): (.+)$'},pascal={'^(.-)%((%d+),(%d+)%) (%w+:.+)$'},perl={'^(.+) at (.-) line (%d+)'},php={'^(.+) in (.-) on line (%d+)$'},pike={'^(.-):(%d+):(.+)$'},pony={'^(.-):(%d+):(%d+): (.+)$'},prolog={'^(.-):(%d+):(%d+): (.+)$','^(.-):(%d+): (.+)$'},pure={'^(.-), line (%d+): (.+)$'},python={'^%s*File "(.-)", line (%d+)'},rexx={'^Error %d+ running "(.-)", line (%d+): (.+)$'},ruby={'^%s+from (.-):(%d+):','^(.-):(%d+):%s*(.+)$'},rust={'^(.-):(%d+):(%d+): (.+)$',"panicked at '([^']+)', (.-):(%d+)"},sass={'^WARNING on line (%d+) of (.-):$','^%s+on line (%d+) of (.-)$'},scala={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},sh={'^(.-): (%d+): %1: (.+)$'},bash={'^(.-): line (%d+): (.+)$'},zsh={'^(.-):(%d+): (.+)$'},smalltalk={'^(.-):(%d+): (.+)$','%((.-):(%d+)%)$'},snobol4={'^(.-):(%d+): (.+)$'},tcl={'^%s*%(file "(.-)" line (%d+)%)$'},tex={'^(.-):(%d+): (.+)$'},typescript={'^(.-):(%d+):(%d+) %- (.+)$'},vala={'^(.-):(%d+)%.(%d+)[%-%.%d]+: (.+)$','^(.-):(%d+):(%d+): (.+)$'},vb={'^(.-)%((%d+),(%d+)%): (.+)$'},xs={'^(.-):(%d+)%S* (.+)$'},zig={'^(.-):(%d+):(%d+): (.+)$'}}$/;" t class:textadept.run
events _HOME/core/events.lua /^module('events')]]$/;" m
events _HOME/core/iface.lua /^M.events = {[2000]={"style_needed","position"},[2001]={"char_added","ch","character_source"},[2002]={"save_point_reached"},[2003]={"save_point_left"},[2004]={"modify_attempt_ro"},[2005]={"key","ch","modifiers"},[2006]={"double_click","position","line","modifiers"},[2007]={"update_ui","updated"},[2008]={"modified","position","modification_type","text","length","lines_added","line","fold_level_now","fold_level_prev","token","annotation_lines_added"},[2009]={"macro_record","message","w_param","l_param"},[2010]={"margin_click","margin","position","modifiers"},[2011]={"need_shown","position","length"},[2013]={"painted"},[2014]={"user_list_selection","list_type","text","position","ch","list_completion_method"},[2015]={"uri_dropped","text"},[2016]={"dwell_start","position","x","y"},[2017]={"dwell_end","position","x","y"},[2018]={"zoom"},[2019]={"hot_spot_click","position","modifiers"},[2020]={"hot_spot_double_click","position","modifiers"},[2021]={"call_tip_click","position"},[2022]={"auto_c_selection","text","position","ch","list_completion_method"},[2023]={"indicator_click","position","modifiers"},[2024]={"indicator_release","position","modifiers"},[2025]={"auto_c_cancelled"},[2026]={"auto_c_char_deleted"},[2027]={"hot_spot_release_click","position","modifiers"},[2028]={"focus_in"},[2029]={"focus_out"},[2030]={"auto_c_completed","text","position","ch","list_completion_method"},[2031]={"margin_right_click","margin","position","modifiers"},[2032]={"auto_c_selection_change","list_type","text","position"},}$/;" t class:_SCINTILLA
expr_types _HOME/modules/lua/init.lua /^M.expr_types = {['^[\'"]'] = 'string', ['^io%.p?open%s*%b()%s*$'] = 'file'}$/;" t class:_M.lua
extend _HOME/lexers/lexer.lua /^module('lexer')]=]$/;" F class:lexer
-extensions _HOME/modules/textadept/file_types.lua /^M.extensions = {--[[Actionscript]]as='actionscript',asc='actionscript',--[[Ada]]adb='ada',ads='ada',--[[ANTLR]]g='antlr',g4='antlr',--[[APDL]]ans='apdl',inp='apdl',mac='apdl',--[[APL]]apl='apl',--[[Applescript]]applescript='applescript',--[[ASM]]asm='asm',ASM='asm',s='asm',S='asm',--[[ASP]]asa='asp',asp='asp',hta='asp',--[[AutoIt]]au3='autoit',a3x='autoit',--[[AWK]]awk='awk',--[[Batch]]bat='batch',cmd='batch',--[[BibTeX]]bib='bibtex',--[[Boo]]boo='boo',--[[C#]]cs='csharp',--[[C/C++]]c='ansi_c',cc='cpp',C='ansi_c',cpp='cpp',cxx='cpp',['c++']='cpp',h='cpp',hh='cpp',hpp='cpp',hxx='cpp',['h++']='cpp',--[[ChucK]]ck='chuck',--[[Clojure]]clj='clojure',cljs='clojure',cljc='clojure',edn='clojure',--[[CMake]]cmake='cmake',['cmake.in']='cmake',ctest='cmake',['ctest.in']='cmake',--[[CoffeeScript]]coffee='coffeescript',--[[Crystal]]cr='crystal',--[[CSS]]css='css',--[[CUDA]]cu='cuda',cuh='cuda',--[[D]]d='dmd',di='dmd',--[[Dart]]dart='dart',--[[Desktop]]desktop='desktop',--[[diff]]diff='diff',patch='diff',--[[Dockerfile]]Dockerfile='dockerfile',--[[dot]]dot='dot',--[[Eiffel]]e='eiffel',eif='eiffel',--[[Elixir]]ex='elixir',exs='elixir',--[[Elm]]elm='elm',--[[Erlang]]erl='erlang',hrl='erlang',--[[F#]]fs='fsharp',--[[Fantom]]fan='fantom',--[[Faust]]dsp='faust',--[[Fennel]]fnl='fennel',--[[Fish]]fish='fish',--[[Forth]]forth='forth',frt='forth',--[[Fortran]]f='fortran',['for']='fortran',ftn='fortran',fpp='fortran',f77='fortran',f90='fortran',f95='fortran',f03='fortran',f08='fortran',--[[fstab]]fstab='fstab',--[[Gap]]g='gap',gd='gap',gi='gap',gap='gap',--[[Gettext]]po='gettext',pot='gettext',--[[Gherkin]]feature='gherkin',--[[GLSL]]glslf='glsl',glslv='glsl',--[[GNUPlot]]dem='gnuplot',plt='gnuplot',--[[Go]]go='go',--[[Groovy]]groovy='groovy',gvy='groovy',--[[Gtkrc]]gtkrc='gtkrc',--[[Haskell]]hs='haskell',--[[HTML]]htm='html',html='html',shtm='html',shtml='html',xhtml='html',vue='html',--[[Icon]]icn='icon',--[[IDL]]idl='idl',odl='idl',--[[Inform]]inf='inform',ni='inform',--[[ini]]cfg='ini',cnf='ini',inf='ini',ini='ini',reg='ini',--[[Io]]io='io_lang',--[[Java]]bsh='java',java='java',--[[Javascript]]js='javascript',jsfl='javascript',--[[jq]]jq='jq',--[[JSON]]json='json',--[[JSP]]jsp='jsp',--[[Julia]]jl='julia',--[[LaTeX]]bbl='latex',dtx='latex',ins='latex',ltx='latex',tex='latex',sty='latex',--[[Ledger]]ledger='ledger',journal='ledger',--[[LESS]]less='less',--[[LilyPond]]lily='lilypond',ly='lilypond',--[[Lisp]]cl='lisp',el='lisp',lisp='lisp',lsp='lisp',--[[Literate Coffeescript]]litcoffee='litcoffee',--[[Logtalk]]lgt='logtalk',--[[Lua]]lua='lua',--[[Makefile]]GNUmakefile='makefile',iface='makefile',mak='makefile',makefile='makefile',Makefile='makefile',--[[Man]]['1']='man',['2']='man',['3']='man',['4']='man',['5']='man',['6']='man',['7']='man',['8']='man',['9']='man',['1x']='man',['2x']='man',['3x']='man',['4x']='man',['5x']='man',['6x']='man',['7x']='man',['8x']='man',['9x']='man',--[[Markdown]]md='markdown',--[[Meson]]['meson.build']='meson',--[[MoonScript]]moon='moonscript',--[[Myrddin]]myr='myrddin',--[[Nemerle]]n='nemerle',--[[Networkd]]link='networkd',network='networkd',netdev='networkd',--[[Nim]]nim='nim',--[[NSIS]]nsh='nsis',nsi='nsis',nsis='nsis',--[[Objective C]]m='objective_c',mm='objective_c',objc='objective_c',--[[OCaml]]caml='caml',ml='caml',mli='caml',mll='caml',mly='caml',--[[Pascal]]dpk='pascal',dpr='pascal',p='pascal',pas='pascal',--[[Perl]]al='perl',perl='perl',pl='perl',pm='perl',pod='perl',--[[PHP]]inc='php',php='php',php3='php',php4='php',phtml='php',--[[PICO-8]]p8='pico8',--[[Pike]]pike='pike',pmod='pike',--[[PKGBUILD]]PKGBUILD='pkgbuild',--[[Pony]]pony='pony',--[[Postscript]]eps='ps',ps='ps',--[[PowerShell]]ps1='powershell',--[[Prolog]]prolog='prolog',--[[Properties]]props='props',properties='props',--[[Protobuf]]proto='protobuf',--[[Pure]]pure='pure',--[[Python]]sc='python',py='python',pyw='python',--[[R]]R='rstats',Rout='rstats',Rhistory='rstats',Rt='rstats',['Rout.save']='rstats',['Rout.fail']='rstats',S='rstats',--[[Reason]]re='reason',--[[REBOL]]r='rebol',reb='rebol',--[[reST]]rst='rest',--[[Rexx]]orx='rexx',rex='rexx',--[[RHTML]]erb='rhtml',rhtml='rhtml',--[[RouterOS]]rsc='routeros',--[[Ruby]]Rakefile='ruby',rake='ruby',rb='ruby',rbw='ruby',--[[Rust]]rs='rust',--[[Sass CSS]]sass='sass',scss='sass',--[[Scala]]scala='scala',--[[Scheme]]sch='scheme',scm='scheme',--[[Shell]]bash='bash',bashrc='bash',bash_profile='bash',configure='bash',csh='bash',ksh='bash',mksh='bash',sh='bash',zsh='bash',--[[Smalltalk]]changes='smalltalk',st='smalltalk',sources='smalltalk',--[[SML]]sml='sml',fun='sml',sig='sml',--[[SNOBOL4]]sno='snobol4',SNO='snobol4',--[[Spin]]spin='spin',--[[SQL]]ddl='sql',sql='sql',--[[Systemd]]automount='systemd',device='systemd',mount='systemd',path='systemd',scope='systemd',service='systemd',slice='systemd',socket='systemd',swap='systemd',target='systemd',timer='systemd',--[[TaskPaper]]taskpaper='taskpaper',--[[Tcl]]tcl='tcl',tk='tcl',--[[Texinfo]]texi='texinfo',--[[TOML]]toml='toml',--[[Txt2tags]]t2t='txt2tags',--[[Vala]]vala='vala',--[[vCard]]vcf='vcard',vcard='vcard',--[[Verilog]]v='verilog',ver='verilog',--[[VHDL]]vh='vhdl',vhd='vhdl',vhdl='vhdl',--[[Visual Basic]]asa='vb',bas='vb',cls='vb',ctl='vb',dob='vb',dsm='vb',dsr='vb',frm='vb',pag='vb',vb='vb',vba='vb',vbs='vb',--[[WSF]]wsf='wsf',--[[XML]]dtd='xml',svg='xml',xml='xml',xsd='xml',xsl='xml',xslt='xml',xul='xml',--[[Xs]]xs='xs',xsin='xs',xsrc='xs',--[[Xtend]]xtend='xtend',--[[YAML]]yaml='yaml',yml='yaml',--[[Zig]]zig='zig'}$/;" t class:textadept.file_types
+extensions _HOME/modules/textadept/file_types.lua /^M.extensions = {--[[Actionscript]]as='actionscript',asc='actionscript',--[[Ada]]adb='ada',ads='ada',--[[ANTLR]]g='antlr',g4='antlr',--[[APDL]]ans='apdl',inp='apdl',mac='apdl',--[[APL]]apl='apl',--[[Applescript]]applescript='applescript',--[[ASM]]asm='asm',ASM='asm',s='asm',S='asm',--[[ASP]]asa='asp',asp='asp',hta='asp',--[[AutoIt]]au3='autoit',a3x='autoit',--[[AWK]]awk='awk',--[[Batch]]bat='batch',cmd='batch',--[[BibTeX]]bib='bibtex',--[[Boo]]boo='boo',--[[C#]]cs='csharp',--[[C/C++]]c='ansi_c',cc='cpp',C='ansi_c',cpp='cpp',cxx='cpp',['c++']='cpp',h='cpp',hh='cpp',hpp='cpp',hxx='cpp',['h++']='cpp',--[[ChucK]]ck='chuck',--[[Clojure]]clj='clojure',cljs='clojure',cljc='clojure',edn='clojure',--[[CMake]]cmake='cmake',['cmake.in']='cmake',ctest='cmake',['ctest.in']='cmake',--[[CoffeeScript]]coffee='coffeescript',--[[Crystal]]cr='crystal',--[[CSS]]css='css',--[[CUDA]]cu='cuda',cuh='cuda',--[[D]]d='dmd',di='dmd',--[[Dart]]dart='dart',--[[Desktop]]desktop='desktop',--[[diff]]diff='diff',patch='diff',--[[Dockerfile]]Dockerfile='dockerfile',--[[dot]]dot='dot',--[[Eiffel]]e='eiffel',eif='eiffel',--[[Elixir]]ex='elixir',exs='elixir',--[[Elm]]elm='elm',--[[Erlang]]erl='erlang',hrl='erlang',--[[F#]]fs='fsharp',--[[Fantom]]fan='fantom',--[[Faust]]dsp='faust',--[[Fennel]]fnl='fennel',--[[Fish]]fish='fish',--[[Forth]]forth='forth',frt='forth',--[[Fortran]]f='fortran',['for']='fortran',ftn='fortran',fpp='fortran',f77='fortran',f90='fortran',f95='fortran',f03='fortran',f08='fortran',--[[fstab]]fstab='fstab',--[[Gap]]g='gap',gd='gap',gi='gap',gap='gap',--[[Gettext]]po='gettext',pot='gettext',--[[Gherkin]]feature='gherkin',--[[GLSL]]glslf='glsl',glslv='glsl',--[[GNUPlot]]dem='gnuplot',plt='gnuplot',--[[Go]]go='go',--[[Groovy]]groovy='groovy',gvy='groovy',--[[Gtkrc]]gtkrc='gtkrc',--[[Haskell]]hs='haskell',--[[HTML]]htm='html',html='html',shtm='html',shtml='html',xhtml='html',vue='html',--[[Icon]]icn='icon',--[[IDL]]idl='idl',odl='idl',--[[Inform]]inf='inform',ni='inform',--[[ini]]cfg='ini',cnf='ini',inf='ini',ini='ini',reg='ini',--[[Io]]io='io_lang',--[[Java]]bsh='java',java='java',--[[Javascript]]js='javascript',jsfl='javascript',--[[jq]]jq='jq',--[[JSON]]json='json',--[[JSP]]jsp='jsp',--[[Julia]]jl='julia',--[[LaTeX]]bbl='latex',dtx='latex',ins='latex',ltx='latex',tex='latex',sty='latex',--[[Ledger]]ledger='ledger',journal='ledger',--[[LESS]]less='less',--[[LilyPond]]lily='lilypond',ly='lilypond',--[[Lisp]]cl='lisp',el='lisp',lisp='lisp',lsp='lisp',--[[Literate Coffeescript]]litcoffee='litcoffee',--[[Logtalk]]lgt='logtalk',--[[Lua]]lua='lua',--[[Makefile]]GNUmakefile='makefile',iface='makefile',mak='makefile',makefile='makefile',Makefile='makefile',--[[Man]]['1']='man',['2']='man',['3']='man',['4']='man',['5']='man',['6']='man',['7']='man',['8']='man',['9']='man',['1x']='man',['2x']='man',['3x']='man',['4x']='man',['5x']='man',['6x']='man',['7x']='man',['8x']='man',['9x']='man',--[[Markdown]]md='markdown',--[[Meson]]['meson.build']='meson',--[[MoonScript]]moon='moonscript',--[[Myrddin]]myr='myrddin',--[[Nemerle]]n='nemerle',--[[Networkd]]link='networkd',network='networkd',netdev='networkd',--[[Nim]]nim='nim',--[[NSIS]]nsh='nsis',nsi='nsis',nsis='nsis',--[[Objective C]]m='objective_c',mm='objective_c',objc='objective_c',--[[OCaml]]caml='caml',ml='caml',mli='caml',mll='caml',mly='caml',--[[Pascal]]dpk='pascal',dpr='pascal',p='pascal',pas='pascal',--[[Perl]]al='perl',perl='perl',pl='perl',pm='perl',pod='perl',--[[PHP]]inc='php',php='php',php3='php',php4='php',phtml='php',--[[PICO-8]]p8='pico8',--[[Pike]]pike='pike',pmod='pike',--[[PKGBUILD]]PKGBUILD='pkgbuild',--[[Pony]]pony='pony',--[[Postscript]]eps='ps',ps='ps',--[[PowerShell]]ps1='powershell',--[[Prolog]]prolog='prolog',--[[Properties]]props='props',properties='props',--[[Protobuf]]proto='protobuf',--[[Pure]]pure='pure',--[[Python]]sc='python',py='python',pyw='python',--[[R]]R='rstats',Rout='rstats',Rhistory='rstats',Rt='rstats',['Rout.save']='rstats',['Rout.fail']='rstats',S='rstats',--[[Reason]]re='reason',--[[REBOL]]r='rebol',reb='rebol',--[[reST]]rst='rest',--[[Rexx]]orx='rexx',rex='rexx',--[[RHTML]]erb='rhtml',rhtml='rhtml',--[[RouterOS]]rsc='routeros',--[[Ruby]]Rakefile='ruby',rake='ruby',rb='ruby',rbw='ruby',--[[Rust]]rs='rust',--[[Sass CSS]]sass='sass',scss='sass',--[[Scala]]scala='scala',--[[Scheme]]sch='scheme',scm='scheme',--[[Shell]]bash='bash',bashrc='bash',bash_profile='bash',configure='bash',csh='bash',ksh='bash',mksh='bash',sh='bash',zsh='bash',--[[Smalltalk]]changes='smalltalk',st='smalltalk',sources='smalltalk',--[[SML]]sml='sml',fun='sml',sig='sml',--[[SNOBOL4]]sno='snobol4',SNO='snobol4',--[[Spin]]spin='spin',--[[SQL]]ddl='sql',sql='sql',--[[Systemd]]automount='systemd',device='systemd',mount='systemd',path='systemd',scope='systemd',service='systemd',slice='systemd',socket='systemd',swap='systemd',target='systemd',timer='systemd',--[[TaskPaper]]taskpaper='taskpaper',--[[Tcl]]tcl='tcl',tk='tcl',--[[Texinfo]]texi='texinfo',--[[TOML]]toml='toml',--[[Txt2tags]]t2t='txt2tags',--[[TypeScript]]ts='typescript',--[[Vala]]vala='vala',--[[vCard]]vcf='vcard',vcard='vcard',--[[Verilog]]v='verilog',ver='verilog',--[[VHDL]]vh='vhdl',vhd='vhdl',vhdl='vhdl',--[[Visual Basic]]asa='vb',bas='vb',cls='vb',ctl='vb',dob='vb',dsm='vb',dsr='vb',frm='vb',pag='vb',vb='vb',vba='vb',vbs='vb',--[[WSF]]wsf='wsf',--[[XML]]dtd='xml',svg='xml',xml='xml',xsd='xml',xsl='xml',xslt='xml',xul='xml',--[[Xs]]xs='xs',xsin='xs',xsrc='xs',--[[Xtend]]xtend='xtend',--[[YAML]]yaml='yaml',yml='yaml',--[[Zig]]zig='zig'}$/;" t class:textadept.file_types
extra_ascent _HOME/core/.view.luadoc /^module('view')$/;" F class:view
extra_descent _HOME/core/.view.luadoc /^module('view')$/;" F class:view
file_types _HOME/modules/textadept/file_types.lua /^module('textadept.file_types')]]$/;" m class:textadept
diff --git a/modules/lua/tags b/modules/lua/tags
index aea9722d..79efd496 100644
--- a/modules/lua/tags
+++ b/modules/lua/tags
@@ -36,14 +36,15 @@ char _HOME/modules/lua/lua.luadoc /^function utf8.char(···) end$/;" f class:u
charpattern _HOME/modules/lua/lua.luadoc /^function utf8.char(···) end$/;" F class:utf8
chdir _HOME/modules/lua/lua.luadoc /^function lfs.chdir(path) end$/;" f class:lfs
clock _HOME/modules/lua/lua.luadoc /^function os.clock() end$/;" f class:os
+close _HOME/modules/lua/lua.luadoc /^function coroutine.close(co) end$/;" f class:coroutine
close _HOME/modules/lua/lua.luadoc /^function file:close() end$/;" f class:file
close _HOME/modules/lua/lua.luadoc /^function io.close([file]) end$/;" f class:io
-codepoint _HOME/modules/lua/lua.luadoc /^function utf8.codepoint(s [, i [, j]]) end$/;" f class:utf8
-codes _HOME/modules/lua/lua.luadoc /^function utf8.codes(s) end$/;" f class:utf8
+codepoint _HOME/modules/lua/lua.luadoc /^function utf8.codepoint(s [, i [, j [, lax]]]) end$/;" f class:utf8
+codes _HOME/modules/lua/lua.luadoc /^function utf8.codes(s [, lax]) end$/;" f class:utf8
collectgarbage _HOME/modules/lua/lua.luadoc /^function collectgarbage([opt [, arg]]) end$/;" f
concat _HOME/modules/lua/lua.luadoc /^function table.concat(list [, sep [, i [, j]]]) end$/;" f class:table
config _HOME/modules/lua/lua.luadoc /^function package.loadlib(libname, funcname) end$/;" F class:package
-coroutine _HOME/modules/lua/lua.luadoc /^function coroutine.create(f) end$/;" m
+coroutine _HOME/modules/lua/lua.luadoc /^function coroutine.close(co) end$/;" m
cos _HOME/modules/lua/lua.luadoc /^function math.cos(x) end$/;" f class:math
cosh _HOME/modules/lua/lua.luadoc /^function math.cosh(x) end$/;" f class:math
cpath _HOME/modules/lua/lua.luadoc /^function package.loadlib(libname, funcname) end$/;" F class:package
@@ -79,18 +80,18 @@ getmetatable _HOME/modules/lua/lua.luadoc /^function debug.getmetatable(value) e
getmetatable _HOME/modules/lua/lua.luadoc /^function getmetatable(object) end$/;" f
getregistry _HOME/modules/lua/lua.luadoc /^function debug.getregistry() end$/;" f class:debug
getupvalue _HOME/modules/lua/lua.luadoc /^function debug.getupvalue(f, up) end$/;" f class:debug
-getuservalue _HOME/modules/lua/lua.luadoc /^function debug.getuservalue(u) end$/;" f class:debug
-gmatch _HOME/modules/lua/lua.luadoc /^function string.gmatch(s, pattern) end$/;" f class:string
+getuservalue _HOME/modules/lua/lua.luadoc /^function debug.getuservalue(u, n) end$/;" f class:debug
+gmatch _HOME/modules/lua/lua.luadoc /^function string.gmatch(s, pattern [, init]) end$/;" f class:string
gsub _HOME/modules/lua/lua.luadoc /^function string.gsub(s, pattern, repl [, n]) end$/;" f class:string
huge _HOME/modules/lua/lua.luadoc /^function math.abs(x) end$/;" F class:math
input _HOME/modules/lua/lua.luadoc /^function io.input([file]) end$/;" f class:io
insert _HOME/modules/lua/lua.luadoc /^function table.insert(list, [pos,] value) end$/;" f class:table
io _HOME/modules/lua/lua.luadoc /^function io.close([file]) end$/;" m
ipairs _HOME/modules/lua/lua.luadoc /^function ipairs(t) end$/;" f
-isyieldable _HOME/modules/lua/lua.luadoc /^function coroutine.isyieldable() end$/;" f class:coroutine
+isyieldable _HOME/modules/lua/lua.luadoc /^function coroutine.isyieldable([co]) end$/;" f class:coroutine
ldexp _HOME/modules/lua/lua.luadoc /^function math.ldexp(m, e) end$/;" f class:math
len _HOME/modules/lua/lua.luadoc /^function string.len(s) end$/;" f class:string
-len _HOME/modules/lua/lua.luadoc /^function utf8.len(s [, i [, j]]) end$/;" f class:utf8
+len _HOME/modules/lua/lua.luadoc /^function utf8.len(s [, i [, j [, lax]]]) end$/;" f class:utf8
lfs _HOME/modules/lua/lua.luadoc /^function lfs.attributes(filepath [, aname | atable]) end$/;" m
lines _HOME/modules/lua/lua.luadoc /^function file:lines(···) end$/;" f class:file
lines _HOME/modules/lua/lua.luadoc /^function io.lines([filename, ···]) end$/;" f class:io
@@ -141,7 +142,7 @@ preload _HOME/modules/lua/lua.luadoc /^function package.loadlib(libname, funcnam
print _HOME/modules/lua/lua.luadoc /^function print(···) end$/;" f
rad _HOME/modules/lua/lua.luadoc /^function math.rad(x) end$/;" f class:math
random _HOME/modules/lua/lua.luadoc /^function math.random([m [, n]]) end$/;" f class:math
-randomseed _HOME/modules/lua/lua.luadoc /^function math.randomseed(x) end$/;" f class:math
+randomseed _HOME/modules/lua/lua.luadoc /^function math.randomseed([x [, y]]) end$/;" f class:math
rawequal _HOME/modules/lua/lua.luadoc /^function rawequal(v1, v2) end$/;" f
rawget _HOME/modules/lua/lua.luadoc /^function rawget(table, index) end$/;" f
rawlen _HOME/modules/lua/lua.luadoc /^function rawlen(v) end$/;" f
@@ -175,7 +176,7 @@ setmetatable _HOME/modules/lua/lua.luadoc /^function debug.setmetatable(value, t
setmetatable _HOME/modules/lua/lua.luadoc /^function setmetatable(table, metatable) end$/;" f
setmode _HOME/modules/lua/lua.luadoc /^function lfs.setmode(file, mode) end$/;" f class:lfs
setupvalue _HOME/modules/lua/lua.luadoc /^function debug.setupvalue(f, up, value) end$/;" f class:debug
-setuservalue _HOME/modules/lua/lua.luadoc /^function debug.setuservalue(udata, value) end$/;" f class:debug
+setuservalue _HOME/modules/lua/lua.luadoc /^function debug.setuservalue(udata, value, n) end$/;" f class:debug
setvbuf _HOME/modules/lua/lua.luadoc /^function file:setvbuf(mode [, size]) end$/;" f class:file
sin _HOME/modules/lua/lua.luadoc /^function math.sin(x) end$/;" f class:math
sinh _HOME/modules/lua/lua.luadoc /^function math.sinh(x) end$/;" f class:math
@@ -213,6 +214,7 @@ upvalueid _HOME/modules/lua/lua.luadoc /^function debug.upvalueid(f, n) end$/;"
upvaluejoin _HOME/modules/lua/lua.luadoc /^function debug.upvaluejoin(f1, n1, f2, n2) end$/;" f class:debug
utf8 _HOME/modules/lua/lua.luadoc /^function utf8.char(···) end$/;" m
version _HOME/modules/lua/lua.luadoc /^function lpeg.version() end$/;" f class:lpeg
+warn _HOME/modules/lua/lua.luadoc /^function warn(msg1, ···) end$/;" f
wrap _HOME/modules/lua/lua.luadoc /^function coroutine.wrap(f) end$/;" f class:coroutine
write _HOME/modules/lua/lua.luadoc /^function file:write(···) end$/;" f class:file
write _HOME/modules/lua/lua.luadoc /^function io.write(···) end$/;" f class:io