From 74cfff6fc6eab13edf896b510f0e25d544a590ab Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Dec 2015 14:49:48 +0100 Subject: [PATCH] Update to LUA 5.2.3, so source changes (nw) --- 3rdparty/lua/Makefile | 2 +- 3rdparty/lua/README | 2 +- 3rdparty/lua/doc/contents.html | 37 ++- 3rdparty/lua/doc/index.css | 21 ++ 3rdparty/lua/doc/lua.css | 136 ++++++--- 3rdparty/lua/doc/manual.css | 14 +- 3rdparty/lua/doc/manual.html | 518 ++++++++++++++++++--------------- 3rdparty/lua/doc/readme.html | 38 +-- 3rdparty/lua/src/Makefile | 60 ++-- 3rdparty/lua/src/lapi.c | 250 +++++++++------- 3rdparty/lua/src/lapi.h | 6 +- 3rdparty/lua/src/lauxlib.c | 90 ++++-- 3rdparty/lua/src/lauxlib.h | 4 +- 3rdparty/lua/src/lbaselib.c | 43 +-- 3rdparty/lua/src/lbitlib.c | 51 ++-- 3rdparty/lua/src/lcode.c | 21 +- 3rdparty/lua/src/ldblib.c | 21 +- 3rdparty/lua/src/ldebug.c | 72 +++-- 3rdparty/lua/src/ldebug.h | 7 +- 3rdparty/lua/src/ldo.c | 204 +++++++++---- 3rdparty/lua/src/ldo.h | 26 +- 3rdparty/lua/src/ldump.c | 9 +- 3rdparty/lua/src/lfunc.h | 9 +- 3rdparty/lua/src/lgc.c | 72 +++-- 3rdparty/lua/src/lgc.h | 41 ++- 3rdparty/lua/src/liolib.c | 44 +-- 3rdparty/lua/src/llex.c | 34 +-- 3rdparty/lua/src/llimits.h | 131 +++++++-- 3rdparty/lua/src/lmathlib.c | 14 +- 3rdparty/lua/src/lmem.c | 11 +- 3rdparty/lua/src/loadlib.c | 9 +- 3rdparty/lua/src/lobject.c | 69 +++-- 3rdparty/lua/src/lobject.h | 119 ++++---- 3rdparty/lua/src/loslib.c | 146 ++++++---- 3rdparty/lua/src/lparser.c | 11 +- 3rdparty/lua/src/lstate.c | 37 +-- 3rdparty/lua/src/lstate.h | 14 +- 3rdparty/lua/src/lstring.c | 112 +++++-- 3rdparty/lua/src/lstring.h | 7 +- 3rdparty/lua/src/lstrlib.c | 277 +++++++++++++----- 3rdparty/lua/src/ltable.c | 193 ++++++------ 3rdparty/lua/src/ltable.h | 7 +- 3rdparty/lua/src/ltablib.c | 380 +++++++++++++++--------- 3rdparty/lua/src/ltm.c | 22 +- 3rdparty/lua/src/lua.c | 50 ++-- 3rdparty/lua/src/lua.h | 13 +- 3rdparty/lua/src/luac.c | 6 +- 3rdparty/lua/src/luaconf.h | 313 +++++++++++--------- 3rdparty/lua/src/lundump.c | 22 +- 3rdparty/lua/src/lundump.h | 5 +- 3rdparty/lua/src/lutf8lib.c | 13 +- 3rdparty/lua/src/lvm.c | 463 ++++++++++++++++++----------- 3rdparty/lua/src/lvm.h | 70 ++++- 3rdparty/lua/src/lzio.c | 12 +- 3rdparty/lua/src/lzio.h | 3 +- scripts/src/3rdparty.lua | 4 + 56 files changed, 2682 insertions(+), 1683 deletions(-) create mode 100644 3rdparty/lua/doc/index.css diff --git a/3rdparty/lua/Makefile b/3rdparty/lua/Makefile index 7fa91c858bb..e87e958c9be 100644 --- a/3rdparty/lua/Makefile +++ b/3rdparty/lua/Makefile @@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1 # Lua version and release. V= 5.3 -R= $V.0 +R= $V.2 # Targets start here. all: $(PLAT) diff --git a/3rdparty/lua/README b/3rdparty/lua/README index 32fb68e77e3..eb6247a49cb 100644 --- a/3rdparty/lua/README +++ b/3rdparty/lua/README @@ -1,5 +1,5 @@ -This is Lua 5.3.0, released on 06 Jan 2015. +This is Lua 5.3.2, released on 25 Nov 2015. For installation instructions, license details, and further information about Lua, see doc/readme.html. diff --git a/3rdparty/lua/doc/contents.html b/3rdparty/lua/doc/contents.html index e59e4215eee..1272c59cdf0 100644 --- a/3rdparty/lua/doc/contents.html +++ b/3rdparty/lua/doc/contents.html @@ -3,35 +3,34 @@ Lua 5.3 Reference Manual - contents + - -

- +Lua Lua 5.3 Reference Manual

The reference manual is the official definition of the Lua language. +
For a complete introduction to Lua programming, see the book Programming in Lua. -

+

+ +

Copyright © 2015 Lua.org, PUC-Rio. Freely available under the terms of the @@ -39,7 +38,7 @@ Freely available under the terms of the

Contents

- +

+It is a good practice to add all needed metamethods to a table +before setting it as a metatable of some object. +In particular, the "__gc" metamethod works only when this order +is followed (see §2.5.1). + + @@ -752,8 +759,6 @@ and the metatable has a field indexed by the string "__gc". Note that if you set a metatable without a __gc field and later create that field in the metatable, the object will not be marked for finalization. -However, after an object has been marked, -you can freely change the __gc field of its metatable.

@@ -794,7 +799,7 @@ Moreover, if the finalizer marks a finalizing object for finalization again, its finalizer will be called again in the next cycle where the object is unreachable. In any case, -the object memory is freed only in the GC cycle where +the object memory is freed only in a GC cycle where the object is unreachable and not marked for finalization. @@ -822,8 +827,8 @@ then the garbage collector will collect that object.

A weak table can have weak keys, weak values, or both. -A table with weak keys allows the collection of its keys, -but prevents the collection of its values. +A table with weak values allows the collection of its values, +but prevents the collection of its keys. A table with both weak keys and weak values allows the collection of both keys and values. In any case, if either the key or the value is collected, @@ -913,10 +918,10 @@ You execute a coroutine by calling corouti When you first call coroutine.resume, passing as its first argument a thread returned by coroutine.create, -the coroutine starts its execution, -at the first line of its main function. +the coroutine starts its execution by +calling its main function. Extra arguments passed to coroutine.resume are passed -as arguments to the coroutine's main function. +as arguments to that function. After the coroutine starts running, it runs until it terminates or yields. @@ -1046,7 +1051,8 @@ except as delimiters between names and keywords. (also called identifiers) in Lua can be any string of letters, digits, and underscores, -not beginning with a digit. +not beginning with a digit and +not being a reserved word. Identifiers are used to name variables, table fields, and labels. @@ -1111,7 +1117,7 @@ into the string contents. Strings in Lua can contain any 8-bit value, including embedded zeros, which can be specified as '\0'. More generally, -we can specify any byte in a literal string by its numerical value. +we can specify any byte in a literal string by its numeric value. This can be done with the escape sequence \xXX, where XX is a sequence of exactly two hexadecimal digits, @@ -1186,7 +1192,7 @@ the five literal strings below denote the same string:

-A numerical constant (or numeral) +A numeric constant (or numeral) can be written with an optional fractional part and an optional decimal exponent, marked by a letter 'e' or 'E'. @@ -1581,11 +1587,11 @@ because now return is the last statement in its (inner) block.

The for statement has two forms: -one numeric and one generic. +one numerical and one generic.

-The numeric for loop repeats a block of code while a +The numerical for loop repeats a block of code while a control variable runs through an arithmetic progression. It has the following syntax: @@ -1879,13 +1885,13 @@ so that it works for non-integer exponents too.

Floor division (//) is a division -that rounds the quotient towards minus infinite, +that rounds the quotient towards minus infinity, that is, the floor of the division of its operands.

Modulo is defined as the remainder of a division -that rounds the quotient towards minus infinite (floor division). +that rounds the quotient towards minus infinity (floor division).

@@ -1972,8 +1978,9 @@ The conversion from strings to numbers goes as follows: First, the string is converted to an integer or a float, following its syntax and the rules of the Lua lexer. (The string may have also leading and trailing spaces and a sign.) -Then, the resulting number is converted to the required type -(float or integer) according to the previous rules. +Then, the resulting number (float or integer) +is converted to the type (float or integer) required by the context +(e.g., the operation that forced the conversion).

@@ -2006,11 +2013,7 @@ Equality (==) first compares the type of its operands. If the types are different, then the result is false. Otherwise, the values of the operands are compared. Strings are compared in the obvious way. -Numbers follow the usual rule for binary operations: -if both operands are integers, -they are compared as integers; -otherwise, they are converted to floats -and compared as such. +Numbers are equal if they denote the same mathematical value.

@@ -2045,8 +2048,8 @@ The operator ~= is exactly the negation of equality (== The order operators work as follows. If both arguments are numbers, -then they are compared following -the usual rule for binary operations. +then they are compared according to their mathematical values +(regardless of their subtypes). Otherwise, if both arguments are strings, then their values are compared according to the current locale. Otherwise, Lua tries to call the "lt" or the "le" @@ -2055,6 +2058,12 @@ A comparison a > b is translated to b < a and a >= b is translated to b <= a. +

+Following the IEEE 754 standard, +NaN is considered neither smaller than, +nor equal to, nor greater than any value (including itself). + + @@ -2636,29 +2645,22 @@ works only with valid indices or acceptable indices.

A valid index is an index that refers to a -real position within the stack, that is, -its position lies between 1 and the stack top -(1 ≤ abs(index) ≤ top). +position that stores a modifiable Lua value. +It comprises stack indices between 1 and the stack top +(1 ≤ abs(index) ≤ top) -Usually, functions that can modify the value at an index -require valid indices. - - -

-Unless otherwise noted, -any function that accepts valid indices also accepts pseudo-indices, -which represent some Lua values that are accessible to C code -but which are not in the stack. -Pseudo-indices are used to access the registry +plus pseudo-indices, +which represent some positions that are accessible to C code +but that are not in the stack. +Pseudo-indices are used to access the registry (see §4.5) and the upvalues of a C function (see §4.4).

-Functions that do not need a specific stack position, -but only a value in the stack (e.g., query functions), +Functions that do not need a specific mutable position, +but only a value (e.g., query functions), can be called with acceptable indices. An acceptable index can be any valid index, -including the pseudo-indices, but it also can be any positive index after the stack top within the space allocated for the stack, that is, indices up to the stack size. @@ -2701,11 +2703,13 @@ Whenever a C function is called, its upvalues are located at specific pseudo-indices. These pseudo-indices are produced by the macro lua_upvalueindex. -The first value associated with a function is at position +The first upvalue associated with a function is at index lua_upvalueindex(1), and so on. Any access to lua_upvalueindex(n), where n is greater than the number of upvalues of the -current function (but not greater than 256), +current function +(but not greater than 256, +which is one plus the maximum number of upvalues in a closure), produces an acceptable but invalid index. @@ -2719,8 +2723,7 @@ Lua provides a registry, a predefined table that can be used by any C code to store whatever Lua values it needs to store. The registry table is always located at pseudo-index -LUA_REGISTRYINDEX, -which is a valid index. +LUA_REGISTRYINDEX. Any C library can store data into this table, but it must take care to choose keys that are different from those used @@ -2971,6 +2974,7 @@ by looking only at its arguments The third field, x, tells whether the function may raise errors: '-' means the function never raises any error; +'m' means the function may raise memory errors; 'e' means the function may raise errors; 'v' means the function may raise an error on purpose. @@ -2981,7 +2985,8 @@ tells whether the function may raise errors:

int lua_absindex (lua_State *L, int idx);

-Converts the acceptable index idx into an absolute index +Converts the acceptable index idx +into an equivalent absolute index (that is, one that does not depend on the stack top). @@ -3142,7 +3147,8 @@ The function results are pushed onto the stack when the function returns. The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from the function are pushed. -Lua takes care that the returned values fit into the stack space. +Lua takes care that the returned values fit into the stack space, +but it does not ensure any extra space in the stack. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack. @@ -3224,7 +3230,7 @@ many results.

As an example, the following function receives a variable number -of numerical arguments and returns their average and their sum: +of numeric arguments and returns their average and their sum:

      static int foo (lua_State *L) {
@@ -3252,14 +3258,15 @@ of numerical arguments and returns their average and their sum:
 
int lua_checkstack (lua_State *L, int n);

-Ensures that the stack has space for at least n extra slots. +Ensures that the stack has space for at least n extra slots +(that is, that you can safely push up to n values into it). It returns false if it cannot fulfill the request, either because it would cause the stack to be larger than a fixed maximum size (typically at least several thousand elements) or because it cannot allocate memory for the extra space. This function never shrinks the stack; -if the stack is already larger than the new size, +if the stack already has space for the extra slots, it is left unchanged. @@ -3344,7 +3351,7 @@ Values at other positions are not affected.


lua_createtable

-[-0, +1, e] +[-0, +1, m]

void lua_createtable (lua_State *L, int narr, int nrec);

@@ -3354,7 +3361,7 @@ will have as a sequence; parameter nrec is a hint for how many other elements the table will have. Lua may use these hints to preallocate memory for the new table. -This pre-allocation is useful for performance when you know in advance +This preallocation is useful for performance when you know in advance how many elements the table will have. Otherwise you can use the function lua_newtable. @@ -3363,7 +3370,7 @@ Otherwise you can use the function lua_newtable

lua_dump

-[-0, +0, e] +[-0, +0, –]

int lua_dump (lua_State *L,
                         lua_Writer writer,
                         void *data,
@@ -3383,8 +3390,9 @@ to write them.
 
 

If strip is true, -the binary representation is created without debug information -about the function. +the binary representation may not include all debug information +about the function, +to save space.

@@ -3661,7 +3669,7 @@ By default this type is long long, (usually a 64-bit two-complement integer), but that can be changed to long or int (usually a 32-bit two-complement integer). -(See LUA_INT in luaconf.h.) +(See LUA_INT_TYPE in luaconf.h.)

@@ -3850,7 +3858,7 @@ and 0 otherwise.

The type for continuation-function contexts. -It must be a numerical type. +It must be a numeric type. This type is defined as intptr_t when intptr_t is available, so that it can store pointers too. @@ -3976,7 +3984,7 @@ passes to the allocator in every call.


lua_newtable

-[-0, +1, e] +[-0, +1, m]

void lua_newtable (lua_State *L);

@@ -3988,7 +3996,7 @@ It is equivalent to lua_createtable(L, 0, 0).


lua_newthread

-[-0, +1, e] +[-0, +1, m]

lua_State *lua_newthread (lua_State *L);

@@ -4009,7 +4017,7 @@ like any Lua object.


lua_newuserdata

-[-0, +1, e] +[-0, +1, m]

void *lua_newuserdata (lua_State *L, size_t size);

@@ -4068,7 +4076,7 @@ the table during its traversal.


lua_Number

-
typedef double lua_Number;
+
typedef ... lua_Number;

The type of floats in Lua. @@ -4076,8 +4084,8 @@ The type of floats in Lua.

By default this type is double, -but that can be changed to a single float. -(See LUA_REAL in luaconf.h.) +but that can be changed to a single float or a long double. +(See LUA_FLOAT_TYPE in luaconf.h.) @@ -4133,7 +4141,7 @@ then the error message returned on the stack is exactly the original error message. Otherwise, msgh is the stack index of a message handler. -(In the current implementation, this index cannot be a pseudo-index.) +(This index cannot be a pseudo-index.) In case of runtime errors, this function will be called with the error message and its return value will be the message @@ -4219,7 +4227,7 @@ Pushes a boolean value with value b onto the stack.


lua_pushcclosure

-[-n, +1, e] +[-n, +1, m]

void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);

@@ -4267,25 +4275,16 @@ when called, invokes the corresponding C function.

-Any function to be registered in Lua must +Any function to be callable by Lua must follow the correct protocol to receive its parameters and return its results (see lua_CFunction). -

-lua_pushcfunction is defined as a macro: - -

-     #define lua_pushcfunction(L,f)  lua_pushcclosure(L,f,0)
-

-Note that f is used twice. - -


lua_pushfstring

-[-0, +1, e] +[-0, +1, m]

const char *lua_pushfstring (lua_State *L, const char *fmt, ...);

@@ -4309,7 +4308,7 @@ The conversion specifiers can only be '%%' (inserts the character '%'), '%s' (inserts a zero-terminated string, with no size restrictions), '%f' (inserts a lua_Number), -'%L' (inserts a lua_Integer), +'%I' (inserts a lua_Integer), '%p' (inserts a pointer as a hexadecimal numeral), '%d' (inserts an int), '%c' (inserts an int as a one-byte character), and @@ -4365,20 +4364,19 @@ light userdata with the same C address.


lua_pushliteral

-[-0, +1, e] +[-0, +1, m]

const char *lua_pushliteral (lua_State *L, const char *s);

-This macro is equivalent to lua_pushlstring, -but can be used only when s is a literal string. -It automatically provides the string length. +This macro is equivalent to lua_pushstring, +but should be used only when s is a literal string.


lua_pushlstring

-[-0, +1, e] +[-0, +1, m]

const char *lua_pushlstring (lua_State *L, const char *s, size_t len);

@@ -4421,7 +4419,7 @@ Pushes a float with value n onto the stack.


lua_pushstring

-[-0, +1, e] +[-0, +1, m]

const char *lua_pushstring (lua_State *L, const char *s);

@@ -4468,7 +4466,7 @@ onto the stack.


lua_pushvfstring

-[-0, +1, e] +[-0, +1, m]

const char *lua_pushvfstring (lua_State *L,
                               const char *fmt,
                               va_list argp);
@@ -4563,7 +4561,7 @@ for other values, it is 0.

lua_rawset

-[-2, +0, e] +[-2, +0, m]

void lua_rawset (lua_State *L, int index);

@@ -4575,7 +4573,7 @@ Similar to lua_settable, but does a raw


lua_rawseti

-[-1, +0, e] +[-1, +0, m]

void lua_rawseti (lua_State *L, int index, lua_Integer i);

@@ -4594,13 +4592,13 @@ that is, it does not invoke metamethods.


lua_rawsetp

-[-1, +0, e] +[-1, +0, m]

void lua_rawsetp (lua_State *L, int index, const void *p);

-Does the equivalent of t[k] = v, +Does the equivalent of t[p] = v, where t is the table at the given index, -k is the pointer p represented as a light userdata, +p is encoded as a light userdata, and v is the value at the top of the stack. @@ -4672,7 +4670,7 @@ because a pseudo-index is not an actual stack position.

Moves the top element into the given valid index without shifting any element -(therefore replacing the value at the given index), +(therefore replacing the value at that given index), and then pops the top element. @@ -4684,7 +4682,7 @@ and then pops the top element.

int lua_resume (lua_State *L, lua_State *from, int nargs);

-Starts and resumes a coroutine in a given thread. +Starts and resumes a coroutine in the given thread L.

@@ -4731,12 +4729,16 @@ this parameter can be NULL.

void lua_rotate (lua_State *L, int idx, int n);

-Rotates the stack elements from idx to the top n positions -in the direction of the top, for a positive n, +Rotates the stack elements between the valid index idx +and the top of the stack. +The elements are rotated n positions in the direction of the top, +for a positive n, or -n positions in the direction of the bottom, for a negative n. The absolute value of n must not be greater than the size of the slice being rotated. +This function cannot be called with a pseudo-index, +because a pseudo-index is not an actual stack position. @@ -4993,13 +4995,13 @@ indicates whether the operation succeeded.


lua_tolstring

-[-0, +0, e] +[-0, +0, m]

const char *lua_tolstring (lua_State *L, int index, size_t *len);

Converts the Lua value at the given index to a C string. If len is not NULL, -it also sets *len with the string length. +it sets *len with the string length. The Lua value must be a string or a number; otherwise, the function returns NULL. If the value is a number, @@ -5010,7 +5012,7 @@ when lua_tolstring is applied to keys during a table traversal.)

-lua_tolstring returns a fully aligned pointer +lua_tolstring returns a pointer to a string inside the Lua state. This string always has a zero ('\0') after its last character (as in C), @@ -5072,14 +5074,14 @@ There is no way to convert the pointer back to its original value.

-Typically this function is used only for debug information. +Typically this function is used only for hashing and debug information.


lua_tostring

-[-0, +0, e] +[-0, +0, m]

const char *lua_tostring (lua_State *L, int index);

@@ -5127,7 +5129,7 @@ Returns the type of the value in the given valid index, or LUA_TNONE for a non-valid (but acceptable) index. The types returned by lua_type are coded by the following constants defined in lua.h: -LUA_TNIL, +LUA_TNIL (0), LUA_TNUMBER, LUA_TBOOLEAN, LUA_TSTRING, @@ -5618,24 +5620,26 @@ it returns 0.

const char *lua_getupvalue (lua_State *L, int funcindex, int n);

-Gets information about a closure's upvalue. -(For Lua functions, -upvalues are the external local variables that the function uses, -and that are consequently included in its closure.) -lua_getupvalue gets the index n of an upvalue, -pushes the upvalue's value onto the stack, +Gets information about the n-th upvalue +of the closure at index funcindex. +It pushes the upvalue's value onto the stack and returns its name. -funcindex points to the closure in the stack. -(Upvalues have no particular order, -as they are active through the whole function. -So, they are numbered in an arbitrary order.) +Returns NULL (and pushes nothing) +when the index n is greater than the number of upvalues.

-Returns NULL (and pushes nothing) -when the index is greater than the number of upvalues. For C functions, this function uses the empty string "" as a name for all upvalues. +(For Lua functions, +upvalues are the external local variables that the function uses, +and that are consequently included in its closure.) + + +

+Upvalues have no particular order, +as they are active through the whole function. +They are numbered in an arbitrary order. @@ -5680,10 +5684,10 @@ that is, they cannot call lua_yieldk,

Hook functions can yield under the following conditions: -Only count and line events can yield -and they cannot yield any value; -to yield a hook function must finish its execution -calling lua_yield with nresults equal to zero. +Only count and line events can yield; +to yield, a hook function must finish its execution +calling lua_yield with nresults equal to zero +(that is, with no values). @@ -5748,9 +5752,7 @@ A hook is disabled by setting mask to zero.

Sets the value of a local variable of a given activation record. -Parameters ar and n are as in lua_getlocal -(see lua_getlocal). -lua_setlocal assigns the value at the top of the stack +It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. @@ -5761,6 +5763,10 @@ when the index is greater than the number of active local variables. +

+Parameters ar and n are as in function lua_getlocal. + + @@ -5773,13 +5779,15 @@ Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. -Parameters funcindex and n are as in the lua_getupvalue -(see lua_getupvalue).

Returns NULL (and pops nothing) -when the index is greater than the number of upvalues. +when the index n is greater than the number of upvalues. + + +

+Parameters funcindex and n are as in function lua_getupvalue. @@ -5792,9 +5800,6 @@ when the index is greater than the number of upvalues.

Returns a unique identifier for the upvalue numbered n from the closure at index funcindex. -Parameters funcindex and n are as in the lua_getupvalue -(see lua_getupvalue) -(but n cannot be greater than the number of upvalues).

@@ -5805,6 +5810,11 @@ Lua closures that share an upvalue will return identical ids for those upvalue indices. +

+Parameters funcindex and n are as in function lua_getupvalue, +but n cannot be greater than the number of upvalues. + + @@ -5880,7 +5890,7 @@ in alphabetical order.


luaL_addchar

-[-?, +?, e] +[-?, +?, m]

void luaL_addchar (luaL_Buffer *B, char c);

@@ -5892,7 +5902,7 @@ Adds the byte c to the buffer B


luaL_addlstring

-[-?, +?, e] +[-?, +?, m]

void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l);

@@ -5906,7 +5916,7 @@ The string can contain embedded zeros.


luaL_addsize

-[-?, +?, e] +[-?, +?, –]

void luaL_addsize (luaL_Buffer *B, size_t n);

@@ -5919,7 +5929,7 @@ buffer area (see luaL_prepbuffer).


luaL_addstring

-[-?, +?, e] +[-?, +?, m]

void luaL_addstring (luaL_Buffer *B, const char *s);

@@ -5932,7 +5942,7 @@ to the buffer B


luaL_addvalue

-[-1, +?, e] +[-1, +?, m]

void luaL_addvalue (luaL_Buffer *B);

@@ -6070,7 +6080,7 @@ the buffer must be declared as a variable


luaL_buffinitsize

-[-?, +?, e] +[-?, +?, m]

char *luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz);

@@ -6321,7 +6331,7 @@ as return luaL_error(args).


luaL_execresult

-[-0, +3, e] +[-0, +3, m]

int luaL_execresult (lua_State *L, int stat);

@@ -6334,7 +6344,7 @@ process-related functions in the standard library


luaL_fileresult

-[-0, +(1|3), e] +[-0, +(1|3), m]

int luaL_fileresult (lua_State *L, int stat, const char *fname);

@@ -6347,7 +6357,7 @@ file-related functions in the standard library


luaL_getmetafield

-[-0, +(0|1), e] +[-0, +(0|1), m]

int luaL_getmetafield (lua_State *L, int obj, const char *e);

@@ -6362,14 +6372,14 @@ pushes nothing and returns LUA_TNIL.


luaL_getmetatable

-[-0, +1, –] +[-0, +1, m]

int luaL_getmetatable (lua_State *L, const char *tname);

Pushes onto the stack the metatable associated with name tname -in the registry (see luaL_newmetatable). -If there is no metatable associated with tname, -returns false and pushes nil. +in the registry (see luaL_newmetatable) +(nil if there is no metatable associated with that name). +Returns the type of the pushed value. @@ -6392,7 +6402,7 @@ and false if it creates a new table.


luaL_gsub

-[-0, +1, e] +[-0, +1, m]

const char *luaL_gsub (lua_State *L,
                        const char *s,
                        const char *p,
@@ -6527,7 +6537,7 @@ it does not run it.
 
 
 

luaL_newlib

-[-0, +1, e] +[-0, +1, m]

void luaL_newlib (lua_State *L, const luaL_Reg l[]);

@@ -6549,7 +6559,7 @@ not a pointer to it.


luaL_newlibtable

-[-0, +1, e] +[-0, +1, m]

void luaL_newlibtable (lua_State *L, const luaL_Reg l[]);

@@ -6570,7 +6580,7 @@ not a pointer to it.


luaL_newmetatable

-[-0, +1, e] +[-0, +1, m]

int luaL_newmetatable (lua_State *L, const char *tname);

@@ -6660,6 +6670,9 @@ Otherwise, raises an error.

If l is not NULL, fills the position *l with the result's length. +If the result is NULL +(only possible when returning d and d == NULL), +its length is considered zero. @@ -6698,7 +6711,7 @@ Otherwise, raises an error.


luaL_prepbuffer

-[-?, +?, e] +[-?, +?, m]

char *luaL_prepbuffer (luaL_Buffer *B);

@@ -6710,7 +6723,7 @@ with the predefined size LUAL_BUFFERSIZE

luaL_prepbuffsize

-[-?, +?, e] +[-?, +?, m]

char *luaL_prepbuffsize (luaL_Buffer *B, size_t sz);

@@ -6726,7 +6739,7 @@ it to the buffer.


luaL_pushresult

-[-?, +1, e] +[-?, +1, m]

void luaL_pushresult (luaL_Buffer *B);

@@ -6738,7 +6751,7 @@ the top of the stack.


luaL_pushresultsize

-[-?, +1, e] +[-?, +1, m]

void luaL_pushresultsize (luaL_Buffer *B, size_t sz);

@@ -6749,7 +6762,7 @@ Equivalent to the sequence luaL_addsize


luaL_ref

-[-1, +0, e] +[-1, +0, m]

int luaL_ref (lua_State *L, int t);

@@ -6820,7 +6833,7 @@ Leaves a copy of the module on the stack.


luaL_setfuncs

-[-nup, +0, e] +[-nup, +0, m]

void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);

@@ -6884,7 +6897,7 @@ this function receives the file handle as its sole argument and must return either true (in case of success) or nil plus an error message (in case of error). Once Lua calls this field, -the field value is changed to NULL +it changes the field value to NULL to signal that the handle is closed. @@ -6892,7 +6905,7 @@ to signal that the handle is closed.


luaL_testudata

-[-0, +0, e] +[-0, +0, m]

void *luaL_testudata (lua_State *L, int arg, const char *tname);

@@ -6928,7 +6941,7 @@ and uses the result of the call as its result.


luaL_traceback

-[-0, +1, e] +[-0, +1, m]

void luaL_traceback (lua_State *L, lua_State *L1, const char *msg,
                      int level);
@@ -6975,7 +6988,7 @@ If ref is LUA_NOREF or

luaL_where

-[-0, +1, e] +[-0, +1, m]

void luaL_where (lua_State *L, int lvl);

@@ -7333,7 +7346,7 @@ 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, +(To traverse a table in numerical order, use a numerical for.) @@ -7472,7 +7485,8 @@ and select returns the total number of extra arguments it received.

Sets the metatable for the given table. -(You cannot change the metatable of other types from Lua, only from C.) +(To change the metatable of other types from Lua code, +you must use the debug library (§6.10).) If metatable is nil, removes the metatable of the given table. If the original metatable has a "__metatable" field, @@ -7522,8 +7536,6 @@ the function returns nil.


tostring (v)

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.) @@ -7555,8 +7567,11 @@ and "userdata".


_VERSION

+ + +

A global variable (not a function) that -holds a string containing the current interpreter version. +holds a string containing the running Lua version. The current value of this variable is "Lua 5.3". @@ -7579,8 +7594,8 @@ except that it sets a new message handler msgh.

6.2 – Coroutine Manipulation

-The operations related to coroutines comprise a sub-library of -the basic library and come inside the table coroutine. +This library comprises the operations to manipulate coroutines, +which come inside the table coroutine. See §2.6 for a general description of coroutines. @@ -7590,7 +7605,7 @@ See §2.6 for a general description of coroutines.

Creates a new coroutine, with body f. -f must be a Lua function. +f must be a function. Returns this new coroutine, an object with type "thread". @@ -7674,7 +7689,7 @@ or if it has stopped with an error.

Creates a new coroutine, with body f. -f must be a Lua function. +f must be a 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. @@ -8073,7 +8088,7 @@ The string library assumes one-byte character encodings.


string.byte (s [, i [, j]])

-Returns the internal numerical codes of the characters s[i], +Returns the internal numeric codes of the characters s[i], s[i+1], ..., s[j]. The default value for i is 1; the default value for j is i. @@ -8082,7 +8097,7 @@ following the same rules of function string.sub<

-Numerical codes are not necessarily portable across platforms. +Numeric codes are not necessarily portable across platforms. @@ -8091,12 +8106,12 @@ Numerical codes are not necessarily portable across platforms.


string.char (···)

Receives zero or more integers. Returns a string with length equal to the number of arguments, -in which each character has the internal numerical code equal +in which each character has the internal numeric code equal to its corresponding argument.

-Numerical codes are not necessarily portable across platforms. +Numeric codes are not necessarily portable across platforms. @@ -8112,9 +8127,9 @@ of the given function, so that a later load on this string returns a copy of the function (but with new upvalues). If strip is a true value, -the binary representation is created without debug information -about the function -(local variable names, lines, etc.). +the binary representation may not include all debug information +about the function, +to save space.

@@ -8138,7 +8153,7 @@ Looks for the first match of If it finds a match, then find returns the indices of s where this occurrence starts and ends; otherwise, it returns nil. -A third, optional numerical argument init specifies +A third, optional numeric argument init specifies where to start the search; its default value is 1 and can be negative. A value of true as a fourth, optional argument plain @@ -8186,16 +8201,23 @@ may produce the string:

Options -A and a (when available), -E, e, f, +A, a, 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 without embedded zeros. -If the argument to option s is not a string, +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 embedded zeros. + + +

+When Lua is compiled with a non-C99 compiler, +options A and a (hexadecimal floats) +do not support any modifier (flags, width, length). @@ -8344,7 +8366,7 @@ 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 +A third, optional numeric argument init specifies where to start the search; its default value is 1 and can be negative. @@ -8385,6 +8407,11 @@ The default value for sep is the empty string Returns the empty string if n is not positive. +

+(Note that it is very easy to exhaust the memory of your machine +with a single call to this function.) + +

@@ -8499,7 +8526,7 @@ represents the character x itself. represents the character x. This is the standard way to escape the magic characters. Any non-alphanumeric character -(including all punctuations, even the non-magical) +(including all punctuation characters, even the non-magical) can be preceded by a '%' when used to represent itself in a pattern. @@ -8904,7 +8931,7 @@ 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. +The number of elements to be moved must fit in a Lua integer. @@ -8956,14 +8983,23 @@ 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 not comp(list[i+1],list[i]) will be true after the sort). +(so that, after the sort, +i < j implies not comp(list[j],list[i])). If comp is not given, then the standard Lua operator < is used instead. +

+Note that the comp function must define +a strict partial order over the elements in the list; +that is, it must be asymmetric and transitive. +Otherwise, no valid sort may be possible. + +

The sort algorithm is not stable; -that is, elements considered equal by the given order +that is, elements not comparable by the given order +(e.g., equal elements) may have their relative positions changed by the sort. @@ -9120,7 +9156,7 @@ that rounds the quotient towards zero. (integer/float)

The float value HUGE_VAL, -a value larger than any other numerical value. +a value larger than any other numeric value. @@ -9215,14 +9251,13 @@ 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 m-n cannot be negative and must fit in a Lua integer.) +(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).

This function is an interface to the underling pseudo-random generator function provided by C. -No guarantees can be given for its statistical properties. @@ -9390,7 +9425,7 @@ instead of returning an error code.

-


io.lines ([filename ···])

+

io.lines ([filename, ···])

@@ -9602,16 +9637,12 @@ 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 +is a valid prefix for a numeral; +if that prefix does not form a valid numeral (e.g., an empty string, "0x", or "3.4e-"), it is discarded and the function returns nil. -

  • "i": -reads an integral number and returns it as an integer. -
  • -
  • "a": reads the whole file, starting at the current position. On end of file, it returns the empty string. @@ -9768,7 +9799,7 @@ 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 (four digits), month (1–12), day (1–31), +year, month (1–12), day (1–31), hour (0–23), min (0–59), sec (0–61), wday (weekday, Sunday is 1), yday (day of the year), @@ -9786,8 +9817,8 @@ 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 -(that is, os.date() is equivalent to os.date("%c")). +the host system and on the current locale. +(More specifically, os.date() is equivalent to os.date("%c").)

    @@ -9946,16 +9977,25 @@ because of its reliance on C function setlocale.

    Returns the current time when called without arguments, -or a time representing the date and time specified by the given table. +or a time representing the local date and time specified by the given table. This table must have fields year, month, and day, and may have fields hour (default is 12), min (default is 0), sec (default is 0), and isdst (default is nil). +Other fields are ignored. For a description of these fields, see the os.date function. +

    +The values in these fields do not need to be inside their valid ranges. +For instance, if sec is -10, +it means -10 seconds from the time specified by the other fields; +if hour is 1000, +it means +1000 hours from 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, @@ -10093,7 +10133,7 @@ valid lines.

    For instance, the expression debug.getinfo(1,"n").name returns -a table with a name for the current function, +a name for the current function, if a reasonable name can be found, and the expression debug.getinfo(print) returns a table with all available information @@ -10599,7 +10639,8 @@ The bit32 library has been deprecated. It is easy to require a compatible external library or, better yet, to replace its functions with appropriate bitwise operations. (Keep in mind that bit32 operates on 32-bit integers, -while the bitwise operators in standard Lua operate on 64-bit integers.) +while the bitwise operators in Lua 5.3 operate on Lua integers, +which by default have 64 bits.)

  • @@ -10614,7 +10655,7 @@ its __ipairs metamethod has been deprecated.
  • Option names in io.read do not have a starting '*' anymore. -For compatibility, Lua will continue to ignore this character. +For compatibility, Lua will continue to accept (and ignore) this character.
  • @@ -10641,6 +10682,12 @@ if it cannot find an open function according to the new style. but it did not document the change.)
  • +
  • +The call collectgarbage("count") now returns only one result. +(You can compute that second result from the fractional part +of the first result.) +
  • + @@ -10776,13 +10823,12 @@ and LiteralString, see §3.1.) -
    - + diff --git a/3rdparty/lua/doc/readme.html b/3rdparty/lua/doc/readme.html index 01657557013..152246f9178 100644 --- a/3rdparty/lua/doc/readme.html +++ b/3rdparty/lua/doc/readme.html @@ -7,9 +7,9 @@