diff --git a/lua/Makefile b/lua/Makefile index bc94dcf8..e87e958c 100644 --- a/lua/Makefile +++ b/lua/Makefile @@ -36,7 +36,7 @@ RM= rm -f # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= # Convenience platforms targets. -PLATS= aix bsd c89 freebsd generic linux macosx mingw posix posix32bit solaris +PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris # What to install. TO_BIN= lua luac @@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1 # Lua version and release. V= 5.3 -R= $V.1 +R= $V.2 # Targets start here. all: $(PLAT) diff --git a/lua/README b/lua/README index 4d26b5e6..eb6247a4 100644 --- a/lua/README +++ b/lua/README @@ -1,9 +1,6 @@ -This is Lua 5.3.1, released on 10 Jun 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. -This is a slightly modified version for ET: Legacy. -The src/Makefile file has been adjusted to fit our -posix and posix32bit requirements. \ No newline at end of file diff --git a/lua/doc/lua.css b/lua/doc/lua.css index b614f3c0..eb20fecd 100644 --- a/lua/doc/lua.css +++ b/lua/doc/lua.css @@ -131,3 +131,29 @@ table.columns td { p.logos a:link:hover, p.logos a:visited:hover { background-color: inherit ; } + +table.book { + border: none ; + border-spacing: 0 ; + border-collapse: collapse ; +} + +table.book td { + padding: 0 ; + vertical-align: top ; +} + +table.book td.cover { + padding-right: 1em ; +} + +table.book img { + border: solid #000080 1px ; +} + +table.book span { + font-size: small ; + text-align: left ; + display: block ; + margin-top: 0.25em ; +} diff --git a/lua/doc/manual.html b/lua/doc/manual.html index f2eb3130..60c4c98b 100644 --- a/lua/doc/manual.html +++ b/lua/doc/manual.html @@ -35,7 +35,7 @@ Freely available under the terms of the
-
+
@@ -398,7 +398,7 @@ You can replace the metatable of tables
using the setmetatable
function.
You cannot change the metatable of other types from Lua code
(except by using the debug library (§6.10));
-you must use the C API for that.
+you should use the C API for that.
@@ -589,7 +589,7 @@ The result of the call is always converted to a boolean.
the <=
(less equal) operation.
Unlike other operations,
-The less-equal operation can use two different events.
+the less-equal operation can use two different events.
First, Lua looks for the "__le
" metamethod in both operands,
like in the "lt" operation.
If it cannot find such a metamethod,
@@ -1051,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.
@@ -2706,7 +2707,9 @@ 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.
@@ -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.
@@ -3143,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.
@@ -3253,14 +3258,15 @@ of numeric 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.
@@ -3345,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);
@@ -3355,7 +3361,7 @@ will have as a sequence;
parameter
-[-0, +0, e]
+[-0, +0, –]
-[-0, +1, e]
+[-0, +1, m]
@@ -3990,7 +3996,7 @@ It is equivalent to
-[-0, +1, e]
+[-0, +1, m]
@@ -4011,7 +4017,7 @@ like any Lua object.
-[-0, +1, e]
+[-0, +1, m]
@@ -4221,7 +4227,7 @@ Pushes a boolean value with value
-[-n, +1, e]
+[-n, +1, m]
@@ -4278,7 +4284,7 @@ and return its results (see
-[-0, +1, e]
+[-0, +1, m]
@@ -4358,7 +4364,7 @@ light userdata with the same C address.
-[-0, +1, e]
+[-0, +1, m]
@@ -4370,7 +4376,7 @@ but should be used only when
-[-0, +1, e]
+[-0, +1, m]
@@ -4413,7 +4419,7 @@ Pushes a float with value
-[-0, +1, e]
+[-0, +1, m]
@@ -4460,7 +4466,7 @@ onto the stack.
-[-0, +1, e]
+[-0, +1, m]
-[-2, +0, e]
+[-2, +0, m]
@@ -4567,7 +4573,7 @@ Similar to
-[-1, +0, e]
+[-1, +0, m]
@@ -4586,7 +4592,7 @@ that is, it does not invoke metamethods.
-[-1, +0, e]
+[-1, +0, m]
@@ -4989,13 +4995,13 @@ indicates whether the operation succeeded.
-[-0, +0, e]
+[-0, +0, m]
Converts the Lua value at the given index to a C string.
If
-
-[-0, +0, e]
+[-0, +0, m]
@@ -5884,7 +5890,7 @@ in alphabetical order.
-[-?, +?, e]
+[-?, +?, m]
@@ -5896,7 +5902,7 @@ Adds the byte
-[-?, +?, e]
+[-?, +?, m]
@@ -5910,7 +5916,7 @@ The string can contain embedded zeros.
-[-?, +?, e]
+[-?, +?, –]
@@ -5923,7 +5929,7 @@ buffer area (see
-[-?, +?, e]
+[-?, +?, m]
@@ -5936,7 +5942,7 @@ to the buffer
-[-1, +?, e]
+[-1, +?, m]
@@ -6074,7 +6080,7 @@ the buffer must be declared as a variable
-[-?, +?, e]
+[-?, +?, m]
@@ -6325,7 +6331,7 @@ as
-[-0, +3, e]
+[-0, +3, m]
@@ -6338,7 +6344,7 @@ process-related functions in the standard library
-[-0, +(1|3), e]
+[-0, +(1|3), m]
@@ -6351,7 +6357,7 @@ file-related functions in the standard library
-[-0, +(0|1), e]
+[-0, +(0|1), m]
@@ -6366,7 +6372,7 @@ pushes nothing and returns
-[-0, +1, –]
+[-0, +1, m]
@@ -6396,7 +6402,7 @@ and false if it creates a new table.
-[-0, +1, e]
+[-0, +1, m]
-[-0, +1, e]
+[-0, +1, m]
@@ -6553,7 +6559,7 @@ not a pointer to it.
-[-0, +1, e]
+[-0, +1, m]
@@ -6574,7 +6580,7 @@ not a pointer to it.
-[-0, +1, e]
+[-0, +1, m]
@@ -6664,6 +6670,9 @@ Otherwise, raises an error.
If
-[-?, +?, e]
+[-?, +?, m]
@@ -6714,7 +6723,7 @@ with the predefined size
-[-?, +?, e]
+[-?, +?, m]
@@ -6730,7 +6739,7 @@ it to the buffer.
-[-?, +1, e]
+[-?, +1, m]
@@ -6742,7 +6751,7 @@ the top of the stack.
-[-?, +1, e]
+[-?, +1, m]
@@ -6753,7 +6762,7 @@ Equivalent to the sequence
-[-1, +0, e]
+[-1, +0, m]
@@ -6824,7 +6833,7 @@ Leaves a copy of the module on the stack.
-[-nup, +0, e]
+[-nup, +0, m]
@@ -6888,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
-[-0, +0, e]
+[-0, +0, m]
@@ -6932,7 +6941,7 @@ and uses the result of the call as its result.
-[-0, +1, e]
+[-0, +1, m]
-[-0, +1, e]
+[-0, +1, m]
@@ -7476,7 +7485,8 @@ and
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
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 "
@@ -8392,6 +8407,11 @@ The default value for
+(Note that it is very easy to exhaust the memory of your machine
+with a single call to this function.)
+
+
@@ -8963,14 +8983,23 @@ If
+Note that the
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.
@@ -9222,14 +9251,13 @@ in the range [0,1).
When called with two integers
This function is an interface to the underling
pseudo-random generator function provided by C.
-No guarantees can be given for its statistical properties.
@@ -9397,7 +9425,7 @@ instead of returning an error code.
-
@@ -9771,7 +9799,7 @@ then the date is formatted in Coordinated Universal Time.
After this optional character,
if
When called without arguments,
@@ -10797,10 +10825,10 @@ and LiteralString, see §3.1.)
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
.
@@ -3364,7 +3370,7 @@ Otherwise you can use the function lua_newtable
lua_dump
int lua_dump (lua_State *L,
lua_Writer writer,
void *data,
@@ -3978,7 +3984,7 @@ passes to the allocator in every call.
lua_newtable
void lua_newtable (lua_State *L);
lua_createtable(L, 0, 0)
.
lua_newthread
lua_State *lua_newthread (lua_State *L);
lua_newuserdata
void *lua_newuserdata (lua_State *L, size_t size);
b
onto the stack.
lua_pushcclosure
void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);
lua_CFunction
<
lua_pushfstring
const char *lua_pushfstring (lua_State *L, const char *fmt, ...);
lua_pushliteral
const char *lua_pushliteral (lua_State *L, const char *s);
s
is a literal string.
lua_pushlstring
const char *lua_pushlstring (lua_State *L, const char *s, size_t len);
n
onto the stack.
lua_pushstring
const char *lua_pushstring (lua_State *L, const char *s);
lua_pushvfstring
const char *lua_pushvfstring (lua_State *L,
const char *fmt,
va_list argp);
@@ -4555,7 +4561,7 @@ for other values, it is 0.
lua_rawset
void lua_rawset (lua_State *L, int index);
lua_settable
, but does a raw
lua_rawseti
void lua_rawseti (lua_State *L, int index, lua_Integer i);
lua_rawsetp
void lua_rawsetp (lua_State *L, int index, const void *p);
lua_tolstring
const char *lua_tolstring (lua_State *L, int index, size_t *len);
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,
@@ -5006,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),
@@ -5075,7 +5081,7 @@ Typically this function is used only for hashing and debug information.
lua_tostring
const char *lua_tostring (lua_State *L, int index);
luaL_addchar
void luaL_addchar (luaL_Buffer *B, char c);
c
to the buffer B
luaL_addlstring
void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l);
luaL_addsize
void luaL_addsize (luaL_Buffer *B, size_t n);
luaL_prepbuffer
).
luaL_addstring
void luaL_addstring (luaL_Buffer *B, const char *s);
B
luaL_addvalue
void luaL_addvalue (luaL_Buffer *B);
luaL_buffinitsize
char *luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz);
return luaL_error(args)
.
luaL_execresult
int luaL_execresult (lua_State *L, int stat);
luaL_fileresult
int luaL_fileresult (lua_State *L, int stat, const char *fname);
luaL_getmetafield
int luaL_getmetafield (lua_State *L, int obj, const char *e);
LUA_TNIL
.
luaL_getmetatable
int luaL_getmetatable (lua_State *L, const char *tname);
luaL_gsub
const char *luaL_gsub (lua_State *L,
const char *s,
const char *p,
@@ -6531,7 +6537,7 @@ it does not run it.
luaL_newlib
void luaL_newlib (lua_State *L, const luaL_Reg l[]);
luaL_newlibtable
void luaL_newlibtable (lua_State *L, const luaL_Reg l[]);
luaL_newmetatable
int luaL_newmetatable (lua_State *L, const char *tname);
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.
@@ -6702,7 +6711,7 @@ Otherwise, raises an error.
luaL_prepbuffer
char *luaL_prepbuffer (luaL_Buffer *B);
LUAL_BUFFERSIZE
luaL_prepbuffsize
char *luaL_prepbuffsize (luaL_Buffer *B, size_t sz);
luaL_pushresult
void luaL_pushresult (luaL_Buffer *B);
luaL_pushresultsize
void luaL_pushresultsize (luaL_Buffer *B, size_t sz);
luaL_addsize
luaL_ref
int luaL_ref (lua_State *L, int t);
luaL_setfuncs
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
NULL
+it changes the field value to NULL
to signal that the handle is closed.
@@ -6896,7 +6905,7 @@ to signal that the handle is closed.
luaL_testudata
void *luaL_testudata (lua_State *L, int arg, const char *tname);
luaL_traceback
void luaL_traceback (lua_State *L, lua_State *L1, const char *msg,
int level);
@@ -6979,7 +6988,7 @@ If ref
is LUA_NOREF
or luaL_where
void luaL_where (lua_State *L, int lvl);
select
returns the total number of extra arguments it received.
metatable
is nil,
removes the metatable of the given table.
If the original metatable has a "__metatable"
field,
@@ -7557,8 +7567,11 @@ and "userdata
".
+
+
+_VERSION
Lua 5.3
".
@@ -8194,9 +8207,11 @@ 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;
+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.
sep
is the empty string
Returns the empty string if n
is not positive.
+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.
+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.
+
+
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)
.
+io.lines ([filename ···])
io.lines ([filename, ···])
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),
@@ -9789,8 +9817,8 @@ formatted according to the same rules as the ISO C function strftime<
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")
.)