History

Lua 5.3.0-rc1

Lua Team committed 11 years ago

Commit 39602181 parent 17ba7315 files · +61 −49Browse files

Unified · Split

5 files
  1. README +1 −1
  2. doc/manual.html +9 −9
  3. doc/readme.html +13 −11
  4. src/lauxlib.c +11 −2
  5. src/luaconf.h +27 −26
README+1−1
@@ -1,5 +1,5 @@
1 1
2This is Lua 5.3.0, released on 11 Dec 2014.2This is Lua 5.3.0, released on 16 Dec 2014.
3 3
4For installation instructions, license details, and4For installation instructions, license details, and
5further information about Lua, see doc/readme.html.5further information about Lua, see doc/readme.html.
doc/manual.html+9−9
@@ -33,7 +33,7 @@ Freely available under the terms of the · 32 unmodified lines
33<!-- ====================================================================== -->33<!-- ====================================================================== -->
34<p>34<p>
35 35
36<!-- $Id: manual.of,v 1.140 2014/12/10 11:58:42 roberto Exp $ -->36<!-- $Id: manual.of,v 1.141 2014/12/16 16:21:31 roberto Exp $ -->
37 37
38 38
39 39
@@ -143,9 +143,9 @@ Standard Lua uses 64-bit integers and double-precision (64-bit) floats, · 103 unmodified lines
143but you can also compile Lua so that it143but you can also compile Lua so that it
144uses 32-bit integers and/or single-precision (32-bit) floats.144uses 32-bit integers and/or single-precision (32-bit) floats.
145The option with 32 bits for both integers and floats 145The option with 32 bits for both integers and floats
146(called <em>Small Lua</em>) is particularly attractive146is particularly attractive
147for small machines and embedded systems.147for small machines and embedded systems.
148(See <code>LUA_INT</code> in file <code>luaconf.h</code>.)148(See macro <code>LUA_32BITS</code> in file <code>luaconf.h</code>.)
149 149
150 150
151<p>151<p>
@@ -1903,7 +1903,7 @@ Lua supports the following bitwise operators: · 1751 unmodified lines
1903 1903
1904<ul>1904<ul>
1905<li><b><code>&amp;</code>: </b>bitwise and</li>1905<li><b><code>&amp;</code>: </b>bitwise and</li>
1906<li><b><code>|</code>: </b>bitwise or</li>1906<li><b><code>&#124;</code>: </b>bitwise or</li>
1907<li><b><code>~</code>: </b>bitwise exclusive or</li>1907<li><b><code>~</code>: </b>bitwise exclusive or</li>
1908<li><b><code>&gt;&gt;</code>: </b>right shift</li>1908<li><b><code>&gt;&gt;</code>: </b>right shift</li>
1909<li><b><code>&lt;&lt;</code>: </b>left shift</li>1909<li><b><code>&lt;&lt;</code>: </b>left shift</li>
@@ -3094,7 +3094,7 @@ The value of <code>op</code> must be one of the following constants: · 1184 unmodified lines
3094<li><b><a name="pdf-LUA_OPUNM"><code>LUA_OPUNM</code></a>: </b> performs mathematical negation (unary <code>-</code>)</li>3094<li><b><a name="pdf-LUA_OPUNM"><code>LUA_OPUNM</code></a>: </b> performs mathematical negation (unary <code>-</code>)</li>
3095<li><b><a name="pdf-LUA_OPBNOT"><code>LUA_OPBNOT</code></a>: </b> performs bitwise negation (<code>~</code>)</li>3095<li><b><a name="pdf-LUA_OPBNOT"><code>LUA_OPBNOT</code></a>: </b> performs bitwise negation (<code>~</code>)</li>
3096<li><b><a name="pdf-LUA_OPBAND"><code>LUA_OPBAND</code></a>: </b> performs bitwise and (<code>&amp;</code>)</li>3096<li><b><a name="pdf-LUA_OPBAND"><code>LUA_OPBAND</code></a>: </b> performs bitwise and (<code>&amp;</code>)</li>
3097<li><b><a name="pdf-LUA_OPBOR"><code>LUA_OPBOR</code></a>| performs bitwise or (<code>: </b></code>)</li>3097<li><b><a name="pdf-LUA_OPBOR"><code>LUA_OPBOR</code></a>: </b> performs bitwise or (<code>|</code>)</li>
3098<li><b><a name="pdf-LUA_OPBXOR"><code>LUA_OPBXOR</code></a>: </b> performs bitwise exclusive or (<code>~</code>)</li>3098<li><b><a name="pdf-LUA_OPBXOR"><code>LUA_OPBXOR</code></a>: </b> performs bitwise exclusive or (<code>~</code>)</li>
3099<li><b><a name="pdf-LUA_OPSHL"><code>LUA_OPSHL</code></a>: </b> performs left shift (<code>&lt;&lt;</code>)</li>3099<li><b><a name="pdf-LUA_OPSHL"><code>LUA_OPSHL</code></a>: </b> performs left shift (<code>&lt;&lt;</code>)</li>
3100<li><b><a name="pdf-LUA_OPSHR"><code>LUA_OPSHR</code></a>: </b> performs right shift (<code>&gt;&gt;</code>)</li>3100<li><b><a name="pdf-LUA_OPSHR"><code>LUA_OPSHR</code></a>: </b> performs right shift (<code>&gt;&gt;</code>)</li>
@@ -7219,9 +7219,9 @@ so that the construction · 4118 unmodified lines
7219<pre>7219<pre>
7220 for i,v in ipairs(t) do <em>body</em> end7220 for i,v in ipairs(t) do <em>body</em> end
7221</pre><p>7221</pre><p>
7222will iterate over the pairs7222will iterate over the key&ndash;value pairs
7223(<code>1,t[1]</code>), (<code>2,t[2]</code>), ...,7223(<code>1,t[1]</code>), (<code>2,t[2]</code>), ...,
7224up to the first integer key absent from the table.7224up to the first nil value.
7225 7225
7226 7226
7227 7227
@@ -10588,7 +10588,7 @@ The <code>bit32</code> library has been deprecated. · 3360 unmodified lines
10588It is easy to require a compatible external library or,10588It is easy to require a compatible external library or,
10589better yet, to replace its functions with appropriate bitwise operations.10589better yet, to replace its functions with appropriate bitwise operations.
10590(Keep in mind that <code>bit32</code> operates on 32-bit integers,10590(Keep in mind that <code>bit32</code> operates on 32-bit integers,
10591while the bitwise operators in Standard Lua operate on 64-bit integers.)10591while the bitwise operators in standard Lua operate on 64-bit integers.)
10592</li>10592</li>
10593 10593
10594<li>10594<li>
@@ -10768,7 +10768,7 @@ and LiteralString, see <a href="#3.1">&sect;3.1</a>.) · 173 unmodified lines
10768<HR>10768<HR>
10769<SMALL CLASS="footer">10769<SMALL CLASS="footer">
10770Last update:10770Last update:
10771Wed Dec 10 15:49:17 BRST 201410771Tue Dec 16 14:45:50 BRST 2014
10772</SMALL>10772</SMALL>
10773<!--10773<!--
10774Last change: revised for Lua 5.3.0 (final)10774Last change: revised for Lua 5.3.0 (final)
doc/readme.html+13−11
@@ -251,6 +251,7 @@ compiler: · 250 unmodified lines
251 be linked statically into the host program and its symbols exported for251 be linked statically into the host program and its symbols exported for
252 dynamic linking; <TT>src/Makefile</TT> does this for the Lua interpreter.252 dynamic linking; <TT>src/Makefile</TT> does this for the Lua interpreter.
253 For Windows, we recommend that the Lua library be a DLL.253 For Windows, we recommend that the Lua library be a DLL.
254 In all cases, the compiler luac should be linked statically.
254 255
255<P>256<P>
256 As mentioned above, you may edit <TT>src/luaconf.h</TT> to customize257 As mentioned above, you may edit <TT>src/luaconf.h</TT> to customize
@@ -268,9 +269,10 @@ lists the · 11 unmodified lines
268<H3>Main changes</H3>269<H3>Main changes</H3>
269<UL>270<UL>
270<LI> integers (64-bit by default)271<LI> integers (64-bit by default)
271<LI> official support for small architectures ("Small Lua" with 32-bit numbers)272<LI> official support for 32-bit numbers
272<LI> bitwise operators273<LI> bitwise operators
273<LI> basic utf-8 support274<LI> basic utf-8 support
275<LI> functions for packing and unpacking values
274 276
275</UL>277</UL>
276 278
@@ -280,30 +282,30 @@ Here are the other changes introduced in Lua 5.3: · 3 unmodified lines
280<LI> userdata can have any Lua value as uservalue282<LI> userdata can have any Lua value as uservalue
281<LI> integer division283<LI> integer division
282<LI> more flexible rules for some metamethods284<LI> more flexible rules for some metamethods
283<LI> utf-8 escapes in literal strings
284</UL>285</UL>
285 286
286<H3>Libraries</H3>287<H3>Libraries</H3>
287<UL>288<UL>
288<LI> basic utf-8 library
289<LI> <CODE>ipairs</CODE> and the table library respect metamethods289<LI> <CODE>ipairs</CODE> and the table library respect metamethods
290<LI> functions for packing and unpacking values
291<LI> strip option in <CODE>string.dump</CODE>290<LI> strip option in <CODE>string.dump</CODE>
292<LI> table library respects metamethods291<LI> table library respects metamethods
293<LI> new function <CODE>table.move</CODE>292<LI> new function <CODE>table.move</CODE>
293<LI> new function <CODE>string.pack</CODE>
294<LI> new function <CODE>string.unpack</CODE>
295<LI> new function <CODE>string.packsize</CODE>
294</UL>296</UL>
295 297
296<H3>C API</H3>298<H3>C API</H3>
297<UL>299<UL>
298<LI> simpler API for continuation functions in C300<LI> simpler API for continuation functions in C
299<LI> new functions:
300<CODE>lua_rotate</CODE>,
301<CODE>lua_isyieldable</CODE>,
302<CODE>lua_stringtonumber</CODE>,
303<CODE>lua_geti</CODE>,
304<CODE>lua_seti</CODE>
305<LI> <CODE>lua_gettable</CODE> and similar functions return type of resulted value301<LI> <CODE>lua_gettable</CODE> and similar functions return type of resulted value
306<LI> strip option in <CODE>lua_dump</CODE>302<LI> strip option in <CODE>lua_dump</CODE>
303<LI> new function: <CODE>lua_geti</CODE>
304<LI> new function: <CODE>lua_seti</CODE>
305<LI> new function: <CODE>lua_isyieldable</CODE>
306<LI> new function: <CODE>lua_numbertointeger</CODE>
307<LI> new function: <CODE>lua_rotate</CODE>
308<LI> new function: <CODE>lua_stringtonumber</CODE>
307</UL>309</UL>
308 310
309<H3>Lua standalone interpreter</H3>311<H3>Lua standalone interpreter</H3>
@@ -359,7 +361,7 @@ THE SOFTWARE. · 49 unmodified lines
359<HR>361<HR>
360<SMALL CLASS="footer">362<SMALL CLASS="footer">
361Last update:363Last update:
362Tue Dec 9 21:16:03 BRST 2014364Fri Dec 12 09:58:42 BRST 2014
363</SMALL>365</SMALL>
364<!--366<!--
365Last change: updated for Lua 5.3.0 (final)367Last change: updated for Lua 5.3.0 (final)
src/lauxlib.c+11−2
@@ -1,5 +1,5 @@
1/*1/*
2** $Id: lauxlib.c,v 1.277 2014/12/10 11:31:32 roberto Exp $2** $Id: lauxlib.c,v 1.279 2014/12/14 18:32:26 roberto Exp $
3** Auxiliary functions for building Lua libraries3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -66,11 +66,20 @@ static int findfield (lua_State *L, int objidx, int level) { · 60 unmodified lines
66}66}
67 67
68 68
69/*
70** Search for a name for a function in all loaded modules
71** (registry._LOADED).
72*/
69static int pushglobalfuncname (lua_State *L, lua_Debug *ar) {73static int pushglobalfuncname (lua_State *L, lua_Debug *ar) {
70 int top = lua_gettop(L);74 int top = lua_gettop(L);
71 lua_getinfo(L, "f", ar); /* push function */75 lua_getinfo(L, "f", ar); /* push function */
72 lua_pushglobaltable(L);76 lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
73 if (findfield(L, top + 1, 2)) {77 if (findfield(L, top + 1, 2)) {
78 const char *name = lua_tostring(L, -1);
79 if (strncmp(name, "_G.", 3) == 0) { /* name start with '_G.'? */
80 lua_pushstring(L, name + 3); /* push name without prefix */
81 lua_remove(L, -2); /* remove original name */
82 }
74 lua_copy(L, -1, top + 1); /* move name to proper place */83 lua_copy(L, -1, top + 1); /* move name to proper place */
75 lua_pop(L, 2); /* remove pushed values */84 lua_pop(L, 2); /* remove pushed values */
76 return 1;85 return 1;
src/luaconf.h+27−26
@@ -1,12 +1,12 @@
1/*1/*
2** $Id: luaconf.h,v 1.231 2014/12/10 11:56:55 roberto Exp $2** $Id: luaconf.h,v 1.235 2014/12/16 17:17:30 roberto Exp $
3** Configuration file for Lua3** Configuration file for Lua
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
6 6
7 7
8#ifndef lconfig_h8#ifndef luaconf_h
9#define lconfig_h9#define luaconf_h
10 10
11#include <limits.h>11#include <limits.h>
12#include <stddef.h>12#include <stddef.h>
@@ -20,18 +20,18 @@ · 7 unmodified lines
20 20
21 21
22/*22/*
23** {==================================================================23** {====================================================================
24** System Configuration: macros to adapt (if needed) Lua to some24** System Configuration: macros to adapt (if needed) Lua to some
25** particular platform, for instance compiling it as Small Lua (3225** particular platform, for instance compiling it with 32-bit numbers or
26** bits) or restricting it to C89.26** restricting it to C89.
27** ===================================================================27** =====================================================================
28*/28*/
29 29
30/*30/*
31@@ LUA_32BITS enables Small Lua (that is, Lua with 32-bit integers31@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You
32** and 32-bit floats). You can also define LUA_32BITS in the make file,32** can also define LUA_32BITS in the make file, but changing here you
33** but changing here you ensure that all software connected to Lua will33** ensure that all software connected to Lua will be compiled with the
34** be compiled with the same configuration.34** same configuration.
35*/35*/
36/* #define LUA_32BITS */36/* #define LUA_32BITS */
37 37
@@ -74,8 +74,8 @@ · 36 unmodified lines
74 74
75/*75/*
76@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for76@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for
77** C89 ('long' and 'double'); Windows has '__int64', so it does not need77** C89 ('long' and 'double'); Windows always has '__int64', so it does
78** to use this case.78** not need to use this case.
79*/79*/
80#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS)80#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS)
81#define LUA_C89_NUMBERS81#define LUA_C89_NUMBERS
@@ -102,8 +102,8 @@ · 20 unmodified lines
102** the type for Lua floats.102** the type for Lua floats.
103** Lua should work fine with any mix of these options (if supported103** Lua should work fine with any mix of these options (if supported
104** by your C compiler). The usual configurations are 64-bit integers104** by your C compiler). The usual configurations are 64-bit integers
105** and 'double' (the default), 32-bit integers and 'float' (Small Lua,105** and 'double' (the default), 32-bit integers and 'float' (for
106** for restricted platforms), and 'long'/'double' (for C compilers not106** restricted platforms), and 'long'/'double' (for C compilers not
107** compliant with C99, which may not have support for 'long long').107** compliant with C99, which may not have support for 'long long').
108*/108*/
109 109
@@ -127,8 +127,7 @@ · 17 unmodified lines
127 127
128#else /* }{ */128#else /* }{ */
129/*129/*
130** default configuration for 64-bit Lua ('long long' and 'double');130** default configuration for 64-bit Lua ('long long' and 'double')
131** Windows will use '__int64'
132*/131*/
133#define LUA_INT_LONGLONG132#define LUA_INT_LONGLONG
134#define LUA_REAL_DOUBLE133#define LUA_REAL_DOUBLE
@@ -565,7 +564,17 @@ · 430 unmodified lines
565 564
566#elif defined(LUA_INT_LONGLONG) /* }{ long long */565#elif defined(LUA_INT_LONGLONG) /* }{ long long */
567 566
568#if defined(LUA_USE_WINDOWS) /* { */567#if defined(LLONG_MAX) /* { */
568/* use ISO C99 stuff */
569
570#define LUA_INTEGER long long
571#define LUA_INTEGER_FRMLEN "ll"
572
573#define LUA_MAXINTEGER LLONG_MAX
574#define LUA_MININTEGER LLONG_MIN
575
576#elif defined(LUA_USE_WINDOWS) /* }{ */
577/* in Windows, can use specific Windows types */
569 578
570#define LUA_INTEGER __int64579#define LUA_INTEGER __int64
571#define LUA_INTEGER_FRMLEN "I64"580#define LUA_INTEGER_FRMLEN "I64"
@@ -575,16 +584,8 @@ · 3 unmodified lines
575 584
576#else /* }{ */585#else /* }{ */
577 586
578#if !defined(LLONG_MAX)
579#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \587#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
580 or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"588 or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
581#endif
582
583#define LUA_INTEGER long long
584#define LUA_INTEGER_FRMLEN "ll"
585
586#define LUA_MAXINTEGER LLONG_MAX
587#define LUA_MININTEGER LLONG_MIN
588 589
589#endif /* } */590#endif /* } */
590 591