| 194 | } |
| 195 | |
| 196 | static void make_assoc(lua_State *L, int tab) { |
| 197 | int i = 1, atab; |
| 198 | lua_newtable(L); atab = lua_gettop(L); |
| 199 | for ( ;; ) { |
| 200 | lua_pushnumber(L, i); |
| 201 | lua_gettable(L, tab); |
| 202 | if (!lua_isnil(L, -1)) { |
| 203 | lua_pushnumber(L, i); |
| 204 | lua_pushvalue(L, -2); |
| 205 | lua_settable(L, atab); |
| 206 | lua_pushnumber(L, i); |
| 207 | lua_settable(L, atab); |
| 208 | } else { |
| 209 | lua_pop(L, 1); |
| 210 | break; |
| 211 | } |
| 212 | i = i+1; |
| 213 | } |
| 214 | } |
no test coverage detected