MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / tconcat

Function tconcat

third-party/lua-5.5.0/src/ltablib.c:167–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165
166
167static int tconcat (lua_State *L) {
168 luaL_Buffer b;
169 lua_Integer last = aux_getn(L, 1, TAB_R);
170 size_t lsep;
171 const char *sep = luaL_optlstring(L, 2, "", &lsep);
172 lua_Integer i = luaL_optinteger(L, 3, 1);
173 last = luaL_optinteger(L, 4, last);
174 luaL_buffinit(L, &b);
175 for (; i < last; i++) {
176 addfield(L, &b, i);
177 luaL_addlstring(&b, sep, lsep);
178 }
179 if (i == last) /* add last value (if interval was not empty) */
180 addfield(L, &b, i);
181 luaL_pushresult(&b);
182 return 1;
183}
184
185
186/*

Callers

nothing calls this directly

Calls 6

luaL_optlstringFunction · 0.70
luaL_optintegerFunction · 0.70
luaL_buffinitFunction · 0.70
addfieldFunction · 0.70
luaL_addlstringFunction · 0.70
luaL_pushresultFunction · 0.70

Tested by

no test coverage detected