| 1121 | |
| 1122 | |
| 1123 | LUA_API int lua_next (lua_State *L, int idx) { |
| 1124 | StkId t; |
| 1125 | int more; |
| 1126 | lua_lock(L); |
| 1127 | t = index2addr(L, idx); |
| 1128 | api_check(L, ttistable(t), "table expected"); |
| 1129 | more = luaH_next(L, hvalue(t), L->top - 1); |
| 1130 | if (more) { |
| 1131 | api_incr_top(L); |
| 1132 | } |
| 1133 | else /* no more elements */ |
| 1134 | L->top -= 1; /* remove key */ |
| 1135 | lua_unlock(L); |
| 1136 | return more; |
| 1137 | } |
| 1138 | |
| 1139 | |
| 1140 | LUA_API void lua_concat (lua_State *L, int n) { |
no test coverage detected