Change the creation/deletion of tangibles so that the tangible database is never really deleted.

This commit is contained in:
2023-03-16 23:31:29 -04:00
parent 86a27ef2d4
commit a8c780563f
9 changed files with 152 additions and 90 deletions

View File

@@ -78,6 +78,10 @@ public:
(*output_) << "<global-env>";
return;
}
case LUA_TT_TANGIBLEMETA: {
(*output_) << "<tangible-metatable>";
return;
}
default: {
(*output_) << "<unknown type #" << xtype << ">";
return;
@@ -103,17 +107,15 @@ public:
// Determine the extended type of the object. If the
// expand flag is true, try to coerce it to a general table.
int type = LS.xtype(value);
if (expand && (LS.istable(value))) {
type = LUA_TT_GENERAL;
}
int xtype = LS.xtype(value);
// If it's anything but a general table, use 'atomic_print'
// and return.
if (type != LUA_TT_GENERAL) {
atomic_print(type, value, true);
LS.result();
return;
// Print the atomic portion.
if (xtype != LUA_TT_GENERAL) {
atomic_print(xtype, value, true);
if ((xtype < LUA_TT_GENERAL) || (!expand)) {
LS.result();
return;
}
}
// Find out whether it has a table number. If necessary,
@@ -189,7 +191,7 @@ public:
// Output the metatable.
LS.getmetatable(val, value);
if (LS.istable(val)) {
if (LS.istable(val) && (LS.gettabletype(val) != LUA_TT_TANGIBLEMETA)) {
multiline = true;
if (needcomma) (*output_) << ",";
needcomma = true;