diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-08 16:32:53 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-08 16:32:53 -0300 |
| commit | 11a70220670f25a9929439f0b27331f09f05235c (patch) | |
| tree | c4a962b5a3e53ac6df8894fb3ad2248c4a1256cb /ltests.c | |
| parent | 35a6ed283881f313152457f24cc6c677122d5058 (diff) | |
| download | lua-11a70220670f25a9929439f0b27331f09f05235c.tar.gz lua-11a70220670f25a9929439f0b27331f09f05235c.tar.bz2 lua-11a70220670f25a9929439f0b27331f09f05235c.zip | |
global variables are stored in a Lua table
Diffstat (limited to '')
| -rw-r--r-- | ltests.c | 7 |
1 files changed, 2 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 1.15 2000/04/13 16:51:01 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.16 2000/04/14 17:46:15 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -167,7 +167,7 @@ static void hash_query (lua_State *L) { | |||
| 167 | lua_Object o = luaL_nonnullarg(L, 1); | 167 | lua_Object o = luaL_nonnullarg(L, 1); |
| 168 | if (lua_getparam(L, 2) == LUA_NOOBJECT) { | 168 | if (lua_getparam(L, 2) == LUA_NOOBJECT) { |
| 169 | luaL_arg_check(L, ttype(o) == TAG_STRING, 1, "string expected"); | 169 | luaL_arg_check(L, ttype(o) == TAG_STRING, 1, "string expected"); |
| 170 | lua_pushnumber(L, tsvalue(o)->hash); | 170 | lua_pushnumber(L, tsvalue(o)->u.s.hash); |
| 171 | } | 171 | } |
| 172 | else { | 172 | else { |
| 173 | const Hash *t = avalue(luaL_tablearg(L, 2)); | 173 | const Hash *t = avalue(luaL_tablearg(L, 2)); |
| @@ -334,9 +334,6 @@ static void testC (lua_State *L) { | |||
| 334 | else if EQ("type") { | 334 | else if EQ("type") { |
| 335 | lua_pushstring(L, lua_type(L, reg[getreg(L, &pc)])); | 335 | lua_pushstring(L, lua_type(L, reg[getreg(L, &pc)])); |
| 336 | } | 336 | } |
| 337 | else if EQ("nextvar") { | ||
| 338 | lua_pushstring(L, lua_nextvar(L, lua_getstring(L, reg[getreg(L, &pc)]))); | ||
| 339 | } | ||
| 340 | else if EQ("next") { | 337 | else if EQ("next") { |
| 341 | int n = getreg(L, &pc); | 338 | int n = getreg(L, &pc); |
| 342 | n = lua_next(L, reg[n], (int)lua_getnumber(L, reg[getreg(L, &pc)])); | 339 | n = lua_next(L, reg[n], (int)lua_getnumber(L, reg[getreg(L, &pc)])); |
