aboutsummaryrefslogtreecommitdiff
path: root/src/table.c
diff options
context:
space:
mode:
authoramelia squires <[email protected]>2025-04-16 13:54:00 -0500
committeramelia squires <[email protected]>2025-04-16 13:54:00 -0500
commitb2ee662b4621282b137a2a2cf1be13bd60073c5a (patch)
tree280ab21571a29f76d880c939642175602e6177e0 /src/table.c
parent8887668e977ff1c6e213768b954b086f6be0738c (diff)
fixes for 5.1v0.0.0
Diffstat (limited to 'src/table.c')
-rw-r--r--src/table.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/table.c b/src/table.c
index 6c3686a..593c31b 100644
--- a/src/table.c
+++ b/src/table.c
@@ -3,6 +3,18 @@
#include <string.h>
#include <stdint.h>
+int l_unpack(lua_State* L){
+ int top = lua_gettop(L);
+ lua_pushnil(L);
+
+ for(;lua_next(L, top);){
+ lua_pushvalue(L, -2);
+ lua_remove(L, -3);
+ }
+
+ return lua_gettop(L) - top;
+}
+
uint64_t i_len(lua_State* L, int pos){
uint64_t i = 0;
lua_pushnil(L);