global variables are stored in a Lua table

This commit is contained in:
Roberto Ierusalimschy
2000-05-08 16:32:53 -03:00
parent 35a6ed2838
commit 11a7022067
21 changed files with 181 additions and 275 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ltests.c,v 1.15 2000/04/13 16:51:01 roberto Exp roberto $
** $Id: ltests.c,v 1.16 2000/04/14 17:46:15 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@@ -167,7 +167,7 @@ static void hash_query (lua_State *L) {
lua_Object o = luaL_nonnullarg(L, 1);
if (lua_getparam(L, 2) == LUA_NOOBJECT) {
luaL_arg_check(L, ttype(o) == TAG_STRING, 1, "string expected");
lua_pushnumber(L, tsvalue(o)->hash);
lua_pushnumber(L, tsvalue(o)->u.s.hash);
}
else {
const Hash *t = avalue(luaL_tablearg(L, 2));
@@ -334,9 +334,6 @@ static void testC (lua_State *L) {
else if EQ("type") {
lua_pushstring(L, lua_type(L, reg[getreg(L, &pc)]));
}
else if EQ("nextvar") {
lua_pushstring(L, lua_nextvar(L, lua_getstring(L, reg[getreg(L, &pc)])));
}
else if EQ("next") {
int n = getreg(L, &pc);
n = lua_next(L, reg[n], (int)lua_getnumber(L, reg[getreg(L, &pc)]));