eris: add general purpose 'flag bits' to lua tables'

This commit is contained in:
2021-07-25 20:34:38 -04:00
parent 9f342854e1
commit bcd5f044d2
5 changed files with 50 additions and 9 deletions

View File

@@ -905,6 +905,9 @@ static void
p_literaltable(Info *info) { /* ... tbl */
eris_checkstack(info->L, 3);
unsigned char bits = lua_getflagbits(info->L, -1);
WRITE_VALUE(bits, uint8_t);
/* Persist all key / value pairs. */
lua_pushnil(info->L); /* ... tbl nil */
while (lua_next(info->L, -2)) { /* ... tbl k v */
@@ -943,6 +946,8 @@ u_literaltable(Info *info) { /* ... */
eris_checkstack(info->L, 3);
lua_newtable(info->L); /* ... tbl */
unsigned char bits = READ_VALUE(uint8_t);
lua_setflagbits(info->L, -1, bits);
/* Preregister table for handling of cycles (keys, values or metatable). */
registerobject(info);