MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / tconcat

Function tconcat

Source/Misc/lua/src/lua.c:14690–14707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14688
14689
14690static int tconcat (lua_State *L) {
14691luaL_Buffer b;
14692size_t lsep;
14693int i, last;
14694const char *sep = luaL_optlstring(L, 2, "", &lsep);
14695luaL_checktype(L, 1, LUA_TTABLE);
14696i = luaL_optint(L, 3, 1);
14697last = luaL_opt(L, luaL_checkint, 4, luaL_getn(L, 1));
14698luaL_buffinit(L, &b);
14699for (; i < last; i++) {
14700addfield(L, &b, i);
14701luaL_addlstring(&b, sep, lsep);
14702}
14703if (i == last) /* add last value (if interval was not empty) */
14704addfield(L, &b, i);
14705luaL_pushresult(&b);
14706return 1;
14707}
14708
14709
14710

Callers

nothing calls this directly

Calls 7

luaL_optlstringFunction · 0.85
luaL_checktypeFunction · 0.85
luaL_getnFunction · 0.85
luaL_buffinitFunction · 0.85
addfieldFunction · 0.85
luaL_addlstringFunction · 0.85
luaL_pushresultFunction · 0.85

Tested by

no test coverage detected