MCPcopy Create free account
hub / github.com/DFHack/dfhack / collectvalidlines

Function collectvalidlines

depends/lua/src/ldebug.c:230–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228
229
230static void collectvalidlines (lua_State *L, Closure *f) {
231 if (noLuaClosure(f)) {
232 setnilvalue(L->top);
233 api_incr_top(L);
234 }
235 else {
236 int i;
237 TValue v;
238 int *lineinfo = f->l.p->lineinfo;
239 Table *t = luaH_new(L); /* new table to store active lines */
240 sethvalue(L, L->top, t); /* push it on stack */
241 api_incr_top(L);
242 setbvalue(&v, 1); /* boolean 'true' to be the value of all indices */
243 for (i = 0; i < f->l.p->sizelineinfo; i++) /* for all lines with code */
244 luaH_setint(L, t, lineinfo[i], &v); /* table[line] = true */
245 }
246}
247
248
249static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {

Callers 1

lua_getinfoFunction · 0.85

Calls 2

luaH_newFunction · 0.85
luaH_setintFunction · 0.85

Tested by

no test coverage detected