| 364 | |
| 365 | |
| 366 | static int luaB_select (lua_State *L) { |
| 367 | int n = lua_gettop(L); |
| 368 | if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') { |
| 369 | lua_pushinteger(L, n-1); |
| 370 | return 1; |
| 371 | } |
| 372 | else { |
| 373 | int i = luaL_checkint(L, 1); |
| 374 | if (i < 0) i = n + i; |
| 375 | else if (i > n) i = n; |
| 376 | luaL_argcheck(L, 1 <= i, 1, "index out of range"); |
| 377 | return n - i; |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | |
| 382 | static int luaB_pcall (lua_State *L) { |
nothing calls this directly
no test coverage detected