summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2011-07-04 12:00:00 +0000
committerrepogen <>2011-07-04 12:00:00 +0000
commitcc3a4be74122bb2c002798696730bca68d36fcc9 (patch)
tree819baa9883530ae9e805464c7d5771b5cbb9a663
parentf6800181d1ead861262d8465110d80116e98ad6e (diff)
downloadlua-github-cc3a4be74122bb2c002798696730bca68d36fcc9.tar.gz
Lua 5.2.0-beta-rc55.2.0-beta-rc5
-rw-r--r--README2
-rw-r--r--doc/manual.html12
-rw-r--r--src/Makefile6
-rw-r--r--src/lbaselib.c12
-rw-r--r--src/llimits.h10
-rw-r--r--src/lparser.c6
-rw-r--r--src/ltablib.c32
-rw-r--r--src/lua.h4
8 files changed, 45 insertions, 39 deletions
diff --git a/README b/README
index ca46c8c4..9fb64eec 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-This is Lua 5.2 (beta), released on 28 Jun 2011.
+This is Lua 5.2 (beta), released on 04 Jul 2011.
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 25322089..5f1ec32d 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -38,7 +38,7 @@ Freely available under the terms of the
<!-- ====================================================================== -->
<p>
-<!-- $Id: manual.of,v 1.82 2011/06/28 17:17:36 roberto Exp $ -->
+<!-- $Id: manual.of,v 1.84 2011/07/04 15:58:56 roberto Exp $ -->
@@ -8152,8 +8152,8 @@ of list <code>t</code>.
<p>
Returns a new table with all parameters stored into keys 1, 2, etc.
and with a field "<code>n</code>" with the total number of parameters.
-Note that the result may not be a sequence,
-if any parameter is <b>nil</b>.
+Also returns, as a second result, the total number of parameters.
+Note that the resulting table may not be a sequence.
@@ -9995,7 +9995,7 @@ and it is easy to set up a module with regular Lua code.
</li>
<li>
-Functions <code>setfenv</code> and <code>getfenv</code> are deprecated,
+Functions <code>setfenv</code> and <code>getfenv</code> were removed,
because of the changes in environments.
</li>
@@ -10096,7 +10096,7 @@ even if it is set later.
</li>
<li>
-<code>luaL_typerror</code> was deprecated.
+<code>luaL_typerror</code> was removed.
Write your own version if you need it.
</li>
@@ -10207,7 +10207,7 @@ Here is the complete syntax of Lua in extended BNF.
<HR>
<SMALL CLASS="footer">
Last update:
-Tue Jun 28 14:51:18 BRT 2011
+Mon Jul 4 16:21:50 BRT 2011
</SMALL>
<!--
Last change: revised for Lua 5.2.0 (beta)
diff --git a/src/Makefile b/src/Makefile
index 9c08aa76..a77f35db 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -22,6 +22,7 @@ SYSLIBS=
MYCFLAGS=
MYLDFLAGS=
MYLIBS=
+MYOBJS=
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
@@ -33,6 +34,7 @@ CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
ltm.o lundump.o lvm.o lzio.o
LIB_O= lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o
+BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
LUA_T= lua
LUA_O= lua.o
@@ -40,7 +42,7 @@ LUA_O= lua.o
LUAC_T= luac
LUAC_O= luac.o
-ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
+ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
ALL_A= $(LUA_A)
@@ -53,7 +55,7 @@ o: $(ALL_O)
a: $(ALL_A)
-$(LUA_A): $(CORE_O) $(LIB_O)
+$(LUA_A): $(BASE_O)
$(AR) $@ $?
$(RANLIB) $@
diff --git a/src/lbaselib.c b/src/lbaselib.c
index 91c21e31..8172f131 100644
--- a/src/lbaselib.c
+++ b/src/lbaselib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lbaselib.c,v 1.262 2011/06/16 14:12:24 roberto Exp $
+** $Id: lbaselib.c,v 1.263 2011/07/02 15:56:43 roberto Exp $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -120,8 +120,8 @@ static int luaB_setmetatable (lua_State *L) {
}
-static int luaB_deprecated (lua_State *L) {
- return luaL_error(L, "deprecated function");
+static int luaB_removed (lua_State *L) {
+ return luaL_error(L, "removed function");
}
@@ -359,7 +359,7 @@ static int luaB_load (lua_State *L) {
#if defined(LUA_COMPAT_LOADSTRING)
#define luaB_loadstring luaB_load
#else
-#define luaB_loadstring luaB_deprecated
+#define luaB_loadstring luaB_removed
#endif
@@ -454,7 +454,7 @@ static const luaL_Reg base_funcs[] = {
{"collectgarbage", luaB_collectgarbage},
{"dofile", luaB_dofile},
{"error", luaB_error},
- {"getfenv", luaB_deprecated},
+ {"getfenv", luaB_removed},
{"getmetatable", luaB_getmetatable},
{"ipairs", luaB_ipairs},
{"loadfile", luaB_loadfile},
@@ -469,7 +469,7 @@ static const luaL_Reg base_funcs[] = {
{"rawget", luaB_rawget},
{"rawset", luaB_rawset},
{"select", luaB_select},
- {"setfenv", luaB_deprecated},
+ {"setfenv", luaB_removed},
{"setmetatable", luaB_setmetatable},
{"tonumber", luaB_tonumber},
{"tostring", luaB_tostring},
diff --git a/src/llimits.h b/src/llimits.h
index b5714413..b64c7b7d 100644
--- a/src/llimits.h
+++ b/src/llimits.h
@@ -1,5 +1,5 @@
/*
-** $Id: llimits.h,v 1.89 2011/05/05 19:43:14 roberto Exp $
+** $Id: llimits.h,v 1.90 2011/07/02 15:57:25 roberto Exp $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ -70,13 +70,17 @@ typedef LUAI_UACNUMBER l_uacNumber;
/*
** assertion for checking API calls
*/
+#if !defined(luai_apicheck)
+
#if defined(LUA_USE_APICHECK)
#include <assert.h>
-#define luai_apicheck(L,e) { (void)L; assert(e); }
-#elif !defined(luai_apicheck)
+#define luai_apicheck(L,e) assert(e)
+#else
#define luai_apicheck(L,e) lua_assert(e)
#endif
+#endif
+
#define api_check(l,e,msg) luai_apicheck(l,(e) && msg)
diff --git a/src/lparser.c b/src/lparser.c
index 6ffecc43..d9c41739 100644
--- a/src/lparser.c
+++ b/src/lparser.c
@@ -1,5 +1,5 @@
/*
-** $Id: lparser.c,v 2.112 2011/06/27 18:18:59 roberto Exp $
+** $Id: lparser.c,v 2.113 2011/07/02 15:58:14 roberto Exp $
** Lua Parser
** See Copyright Notice in lua.h
*/
@@ -1398,13 +1398,11 @@ static void ifstat (LexState *ls, int line) {
static void localfunc (LexState *ls) {
expdesc b;
FuncState *fs = ls->fs;
- int varidx = fs->nactvar; /* index of new local variable */
new_localvar(ls, str_checkname(ls)); /* new local variable */
adjustlocalvars(ls, 1); /* enter its scope */
body(ls, &b, 0, ls->linenumber); /* function created in next register */
- lua_assert(b.k == VNONRELOC && b.u.ind.idx == varidx);
/* debug information will only see the variable after this point! */
- getlocvar(fs, varidx)->startpc = fs->pc;
+ getlocvar(fs, b.u.info)->startpc = fs->pc;
}
diff --git a/src/ltablib.c b/src/ltablib.c
index 0d69fc90..6898442e 100644
--- a/src/ltablib.c
+++ b/src/ltablib.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltablib.c,v 1.59 2010/12/17 12:15:34 roberto Exp $
+** $Id: ltablib.c,v 1.60 2011/07/02 16:01:44 roberto Exp $
** Library for Table Manipulation
** See Copyright Notice in lua.h
*/
@@ -20,8 +20,8 @@
(luaL_checktype(L, n, LUA_TTABLE), luaL_len(L, n))
-static int deprecatedfunc (lua_State *L) {
- return luaL_error(L, "deprecated function");
+static int removedfunc (lua_State *L) {
+ return luaL_error(L, "removed function");
}
@@ -41,7 +41,7 @@ static int maxn (lua_State *L) {
return 1;
}
#else
-#define maxn deprecatedfunc
+#define maxn removedfunc
#endif
@@ -124,18 +124,20 @@ static int tconcat (lua_State *L) {
*/
static int pack (lua_State *L) {
- int top = lua_gettop(L);
- lua_createtable(L, top, 1); /* create result table */
- lua_pushinteger(L, top); /* number of elements */
+ int n = lua_gettop(L); /* number of elements to pack */
+ lua_createtable(L, n, 1); /* create result table */
+ lua_pushinteger(L, n);
lua_setfield(L, -2, "n"); /* t.n = number of elements */
- if (top > 0) { /* at least one element? */
+ if (n > 0) { /* at least one element? */
+ int i;
lua_pushvalue(L, 1);
lua_rawseti(L, -2, 1); /* insert first element */
- lua_replace(L, 1); /* move table into its position (index 1) */
- for (; top >= 2; top--) /* assign other elements */
- lua_rawseti(L, 1, top);
+ lua_replace(L, 1); /* move table into index 1 */
+ for (i = n; i >= 2; i--) /* assign other elements */
+ lua_rawseti(L, 1, i);
}
- return 1;
+ lua_pushinteger(L, n);
+ return 2; /* return table and number of elements */
}
@@ -265,9 +267,9 @@ static int sort (lua_State *L) {
static const luaL_Reg tab_funcs[] = {
{"concat", tconcat},
- {"foreach", deprecatedfunc},
- {"foreachi", deprecatedfunc},
- {"getn", deprecatedfunc},
+ {"foreach", removedfunc},
+ {"foreachi", removedfunc},
+ {"getn", removedfunc},
{"maxn", maxn},
{"insert", tinsert},
{"pack", pack},
diff --git a/src/lua.h b/src/lua.h
index 05d0d565..518d44c4 100644
--- a/src/lua.h
+++ b/src/lua.h
@@ -1,5 +1,5 @@
/*
-** $Id: lua.h,v 1.277 2011/04/18 14:15:48 roberto Exp $
+** $Id: lua.h,v 1.278 2011/07/02 16:00:15 roberto Exp $
** Lua - A Scripting Language
** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
** See Copyright Notice at the end of this file
@@ -18,11 +18,11 @@
#define LUA_VERSION_MAJOR "5"
#define LUA_VERSION_MINOR "2"
+#define LUA_VERSION_NUM 502
#define LUA_VERSION_RELEASE "0" " (beta)"
#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE
-#define LUA_VERSION_NUM 502
#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2011 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes"