MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / collectvalidlines

Function collectvalidlines

extlibs/lua/src/ldebug.c:296–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294
295
296static void collectvalidlines (lua_State *L, Closure *f) {
297 if (noLuaClosure(f)) {
298 setnilvalue(s2v(L->top));
299 api_incr_top(L);
300 }
301 else {
302 int i;
303 TValue v;
304 const Proto *p = f->l.p;
305 int currentline = p->linedefined;
306 Table *t = luaH_new(L); /* new table to store active lines */
307 sethvalue2s(L, L->top, t); /* push it on stack */
308 api_incr_top(L);
309 setbtvalue(&v); /* boolean 'true' to be the value of all indices */
310 for (i = 0; i < p->sizelineinfo; i++) { /* for all lines with code */
311 currentline = nextline(p, currentline, i);
312 luaH_setint(L, t, currentline, &v); /* table[line] = true */
313 }
314 }
315}
316
317
318static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {

Callers 1

lua_getinfoFunction · 0.85

Calls 3

luaH_newFunction · 0.85
nextlineFunction · 0.85
luaH_setintFunction · 0.85

Tested by

no test coverage detected