diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-11 11:42:41 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-11 11:42:41 -0300 |
commit | 0e0e4a480e6d9b0125a96ca982a3e9571578a037 (patch) | |
tree | 21f13f032e9e337879168c74871d0d4bb2534248 /ltests.c | |
parent | 2a501882692afaa08ecc38af3052e9b4f60f6e85 (diff) | |
download | lua-0e0e4a480e6d9b0125a96ca982a3e9571578a037.tar.gz lua-0e0e4a480e6d9b0125a96ca982a3e9571578a037.tar.bz2 lua-0e0e4a480e6d9b0125a96ca982a3e9571578a037.zip |
first implementation for weak tables
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.76 2001/03/09 18:05:05 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.77 2001/03/26 14:31:49 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 | */ |
@@ -337,9 +337,16 @@ static int table_query (lua_State *L) { | |||
337 | return 2; | 337 | return 2; |
338 | } | 338 | } |
339 | else if (i < t->size) { | 339 | else if (i < t->size) { |
340 | TObject o; | 340 | if (ttype(val(node(t, i))) != LUA_TNIL || |
341 | setkey2obj(&o, &t->node[i]); | 341 | ttype_key(node(t, i)) == LUA_TNIL || |
342 | luaA_pushobject(L, &o); | 342 | ttype_key(node(t, i)) == LUA_TNUMBER || |
343 | tsvalue_key(node(t, i)) != NULL) { | ||
344 | TObject o; | ||
345 | setkey2obj(&o, node(t, i)); | ||
346 | luaA_pushobject(L, &o); | ||
347 | } | ||
348 | else | ||
349 | lua_pushstring(L, "<undef>"); | ||
343 | luaA_pushobject(L, &t->node[i].val); | 350 | luaA_pushobject(L, &t->node[i].val); |
344 | if (t->node[i].next) { | 351 | if (t->node[i].next) { |
345 | lua_pushnumber(L, t->node[i].next - t->node); | 352 | lua_pushnumber(L, t->node[i].next - t->node); |