diff_tables and patch_table are working and tested

This commit is contained in:
2021-08-31 20:03:33 -04:00
parent 82f1f69c25
commit 013992400e
10 changed files with 261 additions and 87 deletions

View File

@@ -5,10 +5,10 @@
// routines in this file:
//
// World::number_lua_tables
// World::unnumber_lua_tables
// World::pair_lua_tables
// World::pair_new_tables
// World::number_remaining_tables
// World::create_new_tables
// World::unnumber_lua_tables
//
////////////////////////////////////////////////////////////////////
@@ -76,13 +76,6 @@ int World::number_lua_tables(const IdVector &basis) {
return nextid - 1;
}
void World::unnumber_lua_tables() {
// All we have to do is remove these tables from the registry.
LuaStack LS(state());
LS.rawset(LuaRegistry, "tnmap", LuaNil);
LS.rawset(LuaRegistry, "ntmap", LuaNil);
}
void World::pair_lua_tables(const IdVector &basis, lua_State *master) {
lua_State *synch = state();
LuaVar stangibles, mtangibles, sntmap, mntmap, stnmap, mtnmap, stab, mtab, skey, mkey, sval, mval, sidx, midx;
@@ -182,7 +175,7 @@ void World::pair_lua_tables(const IdVector &basis, lua_State *master) {
SLS.result();
}
int World::pair_new_tables(const IdVector &basis, lua_State *master) {
int World::number_remaining_tables(const IdVector &basis, lua_State *master) {
// This is conceptually recursive, but we're going to use an
// explicit stack (the lua stack).
lua_State *L = master;
@@ -268,4 +261,10 @@ void World::create_new_tables(int n) {
assert(stack_is_clear());
}
void World::unnumber_lua_tables() {
// All we have to do is remove these tables from the registry.
LuaStack LS(state());
LS.rawset(LuaRegistry, "tnmap", LuaNil);
LS.rawset(LuaRegistry, "ntmap", LuaNil);
}