| 1109 | |
| 1110 | |
| 1111 | LUA_API int lua_next (lua_State *L, int idx) { |
| 1112 | StkId t; |
| 1113 | int more; |
| 1114 | lua_lock(L); |
| 1115 | t = index2addr(L, idx); |
| 1116 | api_check(L, ttistable(t), "table expected"); |
| 1117 | more = luaH_next(L, hvalue(t), L->top - 1); |
| 1118 | if (more) { |
| 1119 | api_incr_top(L); |
| 1120 | } |
| 1121 | else /* no more elements */ |
| 1122 | L->top -= 1; /* remove key */ |
| 1123 | lua_unlock(L); |
| 1124 | return more; |
| 1125 | } |
| 1126 | |
| 1127 | |
| 1128 | LUA_API void lua_concat (lua_State *L, int n) { |
no test coverage detected