| 11220 | |
| 11221 | |
| 11222 | static int luaB_select (lua_State *L) { |
| 11223 | int n = lua_gettop(L); |
| 11224 | if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') { |
| 11225 | lua_pushinteger(L, n-1); |
| 11226 | return 1; |
| 11227 | } |
| 11228 | else { |
| 11229 | int i = luaL_checkint(L, 1); |
| 11230 | if (i < 0) i = n + i; |
| 11231 | else if (i > n) i = n; |
| 11232 | luaL_argcheck(L, 1 <= i, 1, "index out of range"); |
| 11233 | return n - i; |
| 11234 | } |
| 11235 | } |
| 11236 | |
| 11237 | |
| 11238 | static int luaB_pcall (lua_State *L) { |
nothing calls this directly
no test coverage detected