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 @@
11
2−This is Lua 5.3.0, released on 11 Dec 2014.
2+This is Lua 5.3.0, released on 16 Dec 2014.
33
44 For installation instructions, license details, and
55 further 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
3333 <!-- ====================================================================== -->
3434 <p>
3535
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 $ -->
3737
3838
3939
@@ -143,9 +143,9 @@ Standard Lua uses 64-bit integers and double-precision (64-bit) floats, · 103 unmodified lines
143143 but you can also compile Lua so that it
144144 uses 32-bit integers and/or single-precision (32-bit) floats.
145145 The option with 32 bits for both integers and floats
146−(called <em>Small Lua</em>) is particularly attractive
146+is particularly attractive
147147 for 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>.)
149149
150150
151151 <p>
@@ -1903,7 +1903,7 @@ Lua supports the following bitwise operators: · 1751 unmodified lines
19031903
19041904 <ul>
19051905 <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>
19071907 <li><b><code>~</code>: </b>bitwise exclusive or</li>
19081908 <li><b><code>&gt;&gt;</code>: </b>right shift</li>
19091909 <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
30943094 <li><b><a name="pdf-LUA_OPUNM"><code>LUA_OPUNM</code></a>: </b> performs mathematical negation (unary <code>-</code>)</li>
30953095 <li><b><a name="pdf-LUA_OPBNOT"><code>LUA_OPBNOT</code></a>: </b> performs bitwise negation (<code>~</code>)</li>
30963096 <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>
30983098 <li><b><a name="pdf-LUA_OPBXOR"><code>LUA_OPBXOR</code></a>: </b> performs bitwise exclusive or (<code>~</code>)</li>
30993099 <li><b><a name="pdf-LUA_OPSHL"><code>LUA_OPSHL</code></a>: </b> performs left shift (<code>&lt;&lt;</code>)</li>
31003100 <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
72197219 <pre>
72207220 for i,v in ipairs(t) do <em>body</em> end
72217221 </pre><p>
7222−will iterate over the pairs
7222+will iterate over the key&ndash;value pairs
72237223 (<code>1,t[1]</code>), (<code>2,t[2]</code>), ...,
7224−up to the first integer key absent from the table.
7224+up to the first nil value.
72257225
72267226
72277227
@@ -10588,7 +10588,7 @@ The <code>bit32</code> library has been deprecated. · 3360 unmodified lines
1058810588 It is easy to require a compatible external library or,
1058910589 better yet, to replace its functions with appropriate bitwise operations.
1059010590 (Keep in mind that <code>bit32</code> operates on 32-bit integers,
10591−while the bitwise operators in Standard Lua operate on 64-bit integers.)
10591+while the bitwise operators in standard Lua operate on 64-bit integers.)
1059210592 </li>
1059310593
1059410594 <li>
@@ -10768,7 +10768,7 @@ and LiteralString, see <a href="#3.1">&sect;3.1</a>.) · 173 unmodified lines
1076810768 <HR>
1076910769 <SMALL CLASS="footer">
1077010770 Last update:
10771−Wed Dec 10 15:49:17 BRST 2014
10771+Tue Dec 16 14:45:50 BRST 2014
1077210772 </SMALL>
1077310773 <!--
1077410774 Last change: revised for Lua 5.3.0 (final)
doc/readme.html+13−11
@@ -251,6 +251,7 @@ compiler: · 250 unmodified lines
251251 be linked statically into the host program and its symbols exported for
252252 dynamic linking; <TT>src/Makefile</TT> does this for the Lua interpreter.
253253 For Windows, we recommend that the Lua library be a DLL.
254+ In all cases, the compiler luac should be linked statically.
254255
255256 <P>
256257 As mentioned above, you may edit <TT>src/luaconf.h</TT> to customize
@@ -268,9 +269,10 @@ lists the · 11 unmodified lines
268269 <H3>Main changes</H3>
269270 <UL>
270271 <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
272273 <LI> bitwise operators
273274 <LI> basic utf-8 support
275+<LI> functions for packing and unpacking values
274276
275277 </UL>
276278
@@ -280,30 +282,30 @@ Here are the other changes introduced in Lua 5.3: · 3 unmodified lines
280282 <LI> userdata can have any Lua value as uservalue
281283 <LI> integer division
282284 <LI> more flexible rules for some metamethods
283−<LI> utf-8 escapes in literal strings
284285 </UL>
285286
286287 <H3>Libraries</H3>
287288 <UL>
288−<LI> basic utf-8 library
289289 <LI> <CODE>ipairs</CODE> and the table library respect metamethods
290−<LI> functions for packing and unpacking values
291290 <LI> strip option in <CODE>string.dump</CODE>
292291 <LI> table library respects metamethods
293292 <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>
294296 </UL>
295297
296298 <H3>C API</H3>
297299 <UL>
298300 <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>
305301 <LI> <CODE>lua_gettable</CODE> and similar functions return type of resulted value
306302 <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>
307309 </UL>
308310
309311 <H3>Lua standalone interpreter</H3>
@@ -359,7 +361,7 @@ THE SOFTWARE. · 49 unmodified lines
359361 <HR>
360362 <SMALL CLASS="footer">
361363 Last update:
362−Tue Dec 9 21:16:03 BRST 2014
364+Fri Dec 12 09:58:42 BRST 2014
363365 </SMALL>
364366 <!--
365367 Last change: updated for Lua 5.3.0 (final)
src/lauxlib.c+11−2
@@ -1,5 +1,5 @@
11 /*
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 $
33 ** Auxiliary functions for building Lua libraries
44 ** See Copyright Notice in lua.h
55 */
@@ -66,11 +66,20 @@ static int findfield (lua_State *L, int objidx, int level) { · 60 unmodified lines
6666 }
6767
6868
69+/*
70+** Search for a name for a function in all loaded modules
71+** (registry._LOADED).
72+*/
6973 static int pushglobalfuncname (lua_State *L, lua_Debug *ar) {
7074 int top = lua_gettop(L);
7175 lua_getinfo(L, "f", ar); /* push function */
72− lua_pushglobaltable(L);
76+ lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
7377 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+ }
7483 lua_copy(L, -1, top + 1); /* move name to proper place */
7584 lua_pop(L, 2); /* remove pushed values */
7685 return 1;
src/luaconf.h+27−26
@@ -1,12 +1,12 @@
11 /*
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 $
33 ** Configuration file for Lua
44 ** See Copyright Notice in lua.h
55 */
66
77
8−#ifndef lconfig_h
9−#define lconfig_h
8+#ifndef luaconf_h
9+#define luaconf_h
1010
1111 #include <limits.h>
1212 #include <stddef.h>
@@ -20,18 +20,18 @@ · 7 unmodified lines
2020
2121
2222 /*
23−** {==================================================================
23+** {====================================================================
2424 ** System Configuration: macros to adapt (if needed) Lua to some
25−** particular platform, for instance compiling it as Small Lua (32
26−** bits) or restricting it to C89.
27−** ===================================================================
25+** particular platform, for instance compiling it with 32-bit numbers or
26+** restricting it to C89.
27+** =====================================================================
2828 */
2929
3030 /*
31−@@ LUA_32BITS enables Small Lua (that is, Lua with 32-bit integers
32−** and 32-bit floats). You can also define LUA_32BITS in the make file,
33−** but changing here you ensure that all software connected to Lua will
34−** be compiled with the same configuration.
31+@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You
32+** can also define LUA_32BITS in the make file, but changing here you
33+** ensure that all software connected to Lua will be compiled with the
34+** same configuration.
3535 */
3636 /* #define LUA_32BITS */
3737
@@ -74,8 +74,8 @@ · 36 unmodified lines
7474
7575 /*
7676 @@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for
77−** C89 ('long' and 'double'); Windows has '__int64', so it does not need
78−** to use this case.
77+** C89 ('long' and 'double'); Windows always has '__int64', so it does
78+** not need to use this case.
7979 */
8080 #if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS)
8181 #define LUA_C89_NUMBERS
@@ -102,8 +102,8 @@ · 20 unmodified lines
102102 ** the type for Lua floats.
103103 ** Lua should work fine with any mix of these options (if supported
104104 ** by your C compiler). The usual configurations are 64-bit integers
105−** and 'double' (the default), 32-bit integers and 'float' (Small Lua,
106−** for restricted platforms), and 'long'/'double' (for C compilers not
105+** and 'double' (the default), 32-bit integers and 'float' (for
106+** restricted platforms), and 'long'/'double' (for C compilers not
107107 ** compliant with C99, which may not have support for 'long long').
108108 */
109109
@@ -127,8 +127,7 @@ · 17 unmodified lines
127127
128128 #else /* }{ */
129129 /*
130−** default configuration for 64-bit Lua ('long long' and 'double');
131−** Windows will use '__int64'
130+** default configuration for 64-bit Lua ('long long' and 'double')
132131 */
133132 #define LUA_INT_LONGLONG
134133 #define LUA_REAL_DOUBLE
@@ -565,7 +564,17 @@ · 430 unmodified lines
565564
566565 #elif defined(LUA_INT_LONGLONG) /* }{ long long */
567566
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 */
569578
570579 #define LUA_INTEGER __int64
571580 #define LUA_INTEGER_FRMLEN "I64"
@@ -575,16 +584,8 @@ · 3 unmodified lines
575584
576585 #else /* }{ */
577586
578−#if !defined(LLONG_MAX)
579587 #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
580588 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
588589
589590 #endif /* } */
590591