summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README2
-rw-r--r--doc/manual.html18
-rw-r--r--doc/readme.html24
-rw-r--r--src/lauxlib.c13
-rw-r--r--src/luaconf.h53
5 files changed, 61 insertions, 49 deletions
diff --git a/README b/README
index aaa63151..0ecb155f 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-This is Lua 5.3.0, released on 11 Dec 2014.
+This is Lua 5.3.0, released on 16 Dec 2014.
For installation instructions, license details, and
further information about Lua, see doc/readme.html.
diff --git a/doc/manual.html b/doc/manual.html
index b8f93990..b64747db 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -33,7 +33,7 @@ Freely available under the terms of the
<!-- ====================================================================== -->
<p>
-<!-- $Id: manual.of,v 1.140 2014/12/10 11:58:42 roberto Exp $ -->
+<!-- $Id: manual.of,v 1.141 2014/12/16 16:21:31 roberto Exp $ -->
@@ -143,9 +143,9 @@ Standard Lua uses 64-bit integers and double-precision (64-bit) floats,
but you can also compile Lua so that it
uses 32-bit integers and/or single-precision (32-bit) floats.
The option with 32 bits for both integers and floats
-(called <em>Small Lua</em>) is particularly attractive
+is particularly attractive
for small machines and embedded systems.
-(See <code>LUA_INT</code> in file <code>luaconf.h</code>.)
+(See macro <code>LUA_32BITS</code> in file <code>luaconf.h</code>.)
<p>
@@ -1903,7 +1903,7 @@ Lua supports the following bitwise operators:
<ul>
<li><b><code>&amp;</code>: </b>bitwise and</li>
-<li><b><code>|</code>: </b>bitwise or</li>
+<li><b><code>&#124;</code>: </b>bitwise or</li>
<li><b><code>~</code>: </b>bitwise exclusive or</li>
<li><b><code>&gt;&gt;</code>: </b>right shift</li>
<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:
<li><b><a name="pdf-LUA_OPUNM"><code>LUA_OPUNM</code></a>: </b> performs mathematical negation (unary <code>-</code>)</li>
<li><b><a name="pdf-LUA_OPBNOT"><code>LUA_OPBNOT</code></a>: </b> performs bitwise negation (<code>~</code>)</li>
<li><b><a name="pdf-LUA_OPBAND"><code>LUA_OPBAND</code></a>: </b> performs bitwise and (<code>&amp;</code>)</li>
-<li><b><a name="pdf-LUA_OPBOR"><code>LUA_OPBOR</code></a>| performs bitwise or (<code>: </b></code>)</li>
+<li><b><a name="pdf-LUA_OPBOR"><code>LUA_OPBOR</code></a>: </b> performs bitwise or (<code>|</code>)</li>
<li><b><a name="pdf-LUA_OPBXOR"><code>LUA_OPBXOR</code></a>: </b> performs bitwise exclusive or (<code>~</code>)</li>
<li><b><a name="pdf-LUA_OPSHL"><code>LUA_OPSHL</code></a>: </b> performs left shift (<code>&lt;&lt;</code>)</li>
<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
<pre>
for i,v in ipairs(t) do <em>body</em> end
</pre><p>
-will iterate over the pairs
+will iterate over the key&ndash;value pairs
(<code>1,t[1]</code>), (<code>2,t[2]</code>), ...,
-up to the first integer key absent from the table.
+up to the first nil value.
@@ -10588,7 +10588,7 @@ The <code>bit32</code> 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 <code>bit32</code> operates on 32-bit integers,
-while the bitwise operators in Standard Lua operate on 64-bit integers.)
+while the bitwise operators in standard Lua operate on 64-bit integers.)
</li>
<li>
@@ -10768,7 +10768,7 @@ and LiteralString, see <a href="#3.1">&sect;3.1</a>.)
<HR>
<SMALL CLASS="footer">
Last update:
-Wed Dec 10 15:49:17 BRST 2014
+Tue Dec 16 14:45:50 BRST 2014
</SMALL>
<!--
Last change: revised for Lua 5.3.0 (final)
diff --git a/doc/readme.html b/doc/readme.html
index 7a2d9dc8..0ace9660 100644
--- a/doc/readme.html
+++ b/doc/readme.html
@@ -251,6 +251,7 @@ compiler:
be linked statically into the host program and its symbols exported for
dynamic linking; <TT>src/Makefile</TT> does this for the Lua interpreter.
For Windows, we recommend that the Lua library be a DLL.
+ In all cases, the compiler luac should be linked statically.
<P>
As mentioned above, you may edit <TT>src/luaconf.h</TT> to customize
@@ -268,9 +269,10 @@ lists the
<H3>Main changes</H3>
<UL>
<LI> integers (64-bit by default)
-<LI> official support for small architectures ("Small Lua" with 32-bit numbers)
+<LI> official support for 32-bit numbers
<LI> bitwise operators
<LI> basic utf-8 support
+<LI> functions for packing and unpacking values
</UL>
@@ -280,30 +282,30 @@ Here are the other changes introduced in Lua 5.3:
<LI> userdata can have any Lua value as uservalue
<LI> integer division
<LI> more flexible rules for some metamethods
-<LI> utf-8 escapes in literal strings
</UL>
<H3>Libraries</H3>
<UL>
-<LI> basic utf-8 library
<LI> <CODE>ipairs</CODE> and the table library respect metamethods
-<LI> functions for packing and unpacking values
<LI> strip option in <CODE>string.dump</CODE>
<LI> table library respects metamethods
<LI> new function <CODE>table.move</CODE>
+<LI> new function <CODE>string.pack</CODE>
+<LI> new function <CODE>string.unpack</CODE>
+<LI> new function <CODE>string.packsize</CODE>
</UL>
<H3>C API</H3>
<UL>
<LI> simpler API for continuation functions in C
-<LI> new functions:
-<CODE>lua_rotate</CODE>,
-<CODE>lua_isyieldable</CODE>,
-<CODE>lua_stringtonumber</CODE>,
-<CODE>lua_geti</CODE>,
-<CODE>lua_seti</CODE>
<LI> <CODE>lua_gettable</CODE> and similar functions return type of resulted value
<LI> strip option in <CODE>lua_dump</CODE>
+<LI> new function: <CODE>lua_geti</CODE>
+<LI> new function: <CODE>lua_seti</CODE>
+<LI> new function: <CODE>lua_isyieldable</CODE>
+<LI> new function: <CODE>lua_numbertointeger</CODE>
+<LI> new function: <CODE>lua_rotate</CODE>
+<LI> new function: <CODE>lua_stringtonumber</CODE>
</UL>
<H3>Lua standalone interpreter</H3>
@@ -359,7 +361,7 @@ THE SOFTWARE.
<HR>
<SMALL CLASS="footer">
Last update:
-Tue Dec 9 21:16:03 BRST 2014
+Fri Dec 12 09:58:42 BRST 2014
</SMALL>
<!--
Last change: updated for Lua 5.3.0 (final)
diff --git a/src/lauxlib.c b/src/lauxlib.c
index 2387141b..1c41d6a8 100644
--- a/src/lauxlib.c
+++ b/src/lauxlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lauxlib.c,v 1.277 2014/12/10 11:31:32 roberto Exp $
+** $Id: lauxlib.c,v 1.279 2014/12/14 18:32:26 roberto Exp $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -66,11 +66,20 @@ static int findfield (lua_State *L, int objidx, int level) {
}
+/*
+** Search for a name for a function in all loaded modules
+** (registry._LOADED).
+*/
static int pushglobalfuncname (lua_State *L, lua_Debug *ar) {
int top = lua_gettop(L);
lua_getinfo(L, "f", ar); /* push function */
- lua_pushglobaltable(L);
+ lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
if (findfield(L, top + 1, 2)) {
+ const char *name = lua_tostring(L, -1);
+ if (strncmp(name, "_G.", 3) == 0) { /* name start with '_G.'? */
+ lua_pushstring(L, name + 3); /* push name without prefix */
+ lua_remove(L, -2); /* remove original name */
+ }
lua_copy(L, -1, top + 1); /* move name to proper place */
lua_pop(L, 2); /* remove pushed values */
return 1;
diff --git a/src/luaconf.h b/src/luaconf.h
index 593ccd8d..f470f0eb 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -1,12 +1,12 @@
/*
-** $Id: luaconf.h,v 1.231 2014/12/10 11:56:55 roberto Exp $
+** $Id: luaconf.h,v 1.235 2014/12/16 17:17:30 roberto Exp $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
-#ifndef lconfig_h
-#define lconfig_h
+#ifndef luaconf_h
+#define luaconf_h
#include <limits.h>
#include <stddef.h>
@@ -20,18 +20,18 @@
/*
-** {==================================================================
+** {====================================================================
** System Configuration: macros to adapt (if needed) Lua to some
-** particular platform, for instance compiling it as Small Lua (32
-** bits) or restricting it to C89.
-** ===================================================================
+** particular platform, for instance compiling it with 32-bit numbers or
+** restricting it to C89.
+** =====================================================================
*/
/*
-@@ LUA_32BITS enables Small Lua (that is, Lua with 32-bit integers
-** and 32-bit floats). You can also define LUA_32BITS in the make file,
-** but changing here you ensure that all software connected to Lua will
-** be compiled with the same configuration.
+@@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. You
+** can also define LUA_32BITS in the make file, but changing here you
+** ensure that all software connected to Lua will be compiled with the
+** same configuration.
*/
/* #define LUA_32BITS */
@@ -74,8 +74,8 @@
/*
@@ LUA_C89_NUMBERS ensures that Lua uses the largest types available for
-** C89 ('long' and 'double'); Windows has '__int64', so it does not need
-** to use this case.
+** C89 ('long' and 'double'); Windows always has '__int64', so it does
+** not need to use this case.
*/
#if defined(LUA_USE_C89) && !defined(LUA_USE_WINDOWS)
#define LUA_C89_NUMBERS
@@ -102,8 +102,8 @@
** the type for Lua floats.
** Lua should work fine with any mix of these options (if supported
** by your C compiler). The usual configurations are 64-bit integers
-** and 'double' (the default), 32-bit integers and 'float' (Small Lua,
-** for restricted platforms), and 'long'/'double' (for C compilers not
+** and 'double' (the default), 32-bit integers and 'float' (for
+** restricted platforms), and 'long'/'double' (for C compilers not
** compliant with C99, which may not have support for 'long long').
*/
@@ -127,8 +127,7 @@
#else /* }{ */
/*
-** default configuration for 64-bit Lua ('long long' and 'double');
-** Windows will use '__int64'
+** default configuration for 64-bit Lua ('long long' and 'double')
*/
#define LUA_INT_LONGLONG
#define LUA_REAL_DOUBLE
@@ -565,7 +564,17 @@
#elif defined(LUA_INT_LONGLONG) /* }{ long long */
-#if defined(LUA_USE_WINDOWS) /* { */
+#if defined(LLONG_MAX) /* { */
+/* use ISO C99 stuff */
+
+#define LUA_INTEGER long long
+#define LUA_INTEGER_FRMLEN "ll"
+
+#define LUA_MAXINTEGER LLONG_MAX
+#define LUA_MININTEGER LLONG_MIN
+
+#elif defined(LUA_USE_WINDOWS) /* }{ */
+/* in Windows, can use specific Windows types */
#define LUA_INTEGER __int64
#define LUA_INTEGER_FRMLEN "I64"
@@ -575,16 +584,8 @@
#else /* }{ */
-#if !defined(LLONG_MAX)
#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
-#endif
-
-#define LUA_INTEGER long long
-#define LUA_INTEGER_FRMLEN "ll"
-
-#define LUA_MAXINTEGER LLONG_MAX
-#define LUA_MININTEGER LLONG_MIN
#endif /* } */