aboutsummaryrefslogtreecommitdiff
path: root/src/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools.c')
-rw-r--r--src/tools.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tools.c b/src/tools.c
index 628b277..e0f4c40 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -446,6 +446,8 @@ static void populate_func_lookup_table_recur( lua_State* L, int _ctx_base, int _
446 // prepare the stack for database feed 446 // prepare the stack for database feed
447 lua_pushvalue( L, -1); // ... {_i} {bfc} k func "f.q.n" "f.q.n" 447 lua_pushvalue( L, -1); // ... {_i} {bfc} k func "f.q.n" "f.q.n"
448 lua_pushvalue( L, -3); // ... {_i} {bfc} k func "f.q.n" "f.q.n" func 448 lua_pushvalue( L, -3); // ... {_i} {bfc} k func "f.q.n" "f.q.n" func
449 ASSERT_L( lua_rawequal( L, -1, -4));
450 ASSERT_L( lua_rawequal( L, -2, -3));
449 // t["f.q.n"] = func 451 // t["f.q.n"] = func
450 lua_rawset( L, dest); // ... {_i} {bfc} k func "f.q.n" 452 lua_rawset( L, dest); // ... {_i} {bfc} k func "f.q.n"
451 // t[func] = "f.q.n" 453 // t[func] = "f.q.n"
@@ -704,6 +706,23 @@ lua_State* luaG_newstate( struct s_Universe* U, lua_State* from_, char const* li
704 // after all this, register everything we find in our name<->function database 706 // after all this, register everything we find in our name<->function database
705 lua_pushglobaltable( L); // Lua 5.2 no longer has LUA_GLOBALSINDEX: we must push globals table on the stack 707 lua_pushglobaltable( L); // Lua 5.2 no longer has LUA_GLOBALSINDEX: we must push globals table on the stack
706 populate_func_lookup_table( L, -1, NULL); 708 populate_func_lookup_table( L, -1, NULL);
709
710#if 0 && USE_DEBUG_SPEW
711 // dump the lookup database contents
712 lua_getfield( L, LUA_REGISTRYINDEX, LOOKUP_REGKEY); // {}
713 lua_pushnil( L); // {} nil
714 while( lua_next( L, -2)) // {} k v
715 {
716 lua_getglobal( L, "print"); // {} k v print
717 lua_pushlstring( L, debugspew_indent, U->debugspew_indent_depth); // {} k v print " "
718 lua_pushvalue( L, -4); // {} k v print " " k
719 lua_pushvalue( L, -4); // {} k v print " " k v
720 lua_call( L, 3, 0); // {} k v
721 lua_pop( L, 1); // {} k
722 }
723 lua_pop( L, 1); // {}
724#endif // USE_DEBUG_SPEW
725
707 lua_pop( L, 1); 726 lua_pop( L, 1);
708 STACK_END( L, 0); 727 STACK_END( L, 0);
709 DEBUGSPEW_CODE( -- U->debugspew_indent_depth); 728 DEBUGSPEW_CODE( -- U->debugspew_indent_depth);