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

Function luaF_getlocalname

Source/Misc/lua/src/lua.c:5991–6001  ·  view source on GitHub ↗

** Look for n-th local variable at line `line' in function `func'. ** Returns NULL if not found. */

Source from the content-addressed store, hash-verified

5989** Returns NULL if not found.
5990*/
5991const char *luaF_getlocalname (const Proto *f, int local_number, int pc) {
5992int i;
5993for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) {
5994if (pc < f->locvars[i].endpc) { /* is variable active? */
5995local_number--;
5996if (local_number == 0)
5997return getstr(f->locvars[i].varname);
5998}
5999}
6000return NULL; /* not found */
6001}
6002
6003/*
6004** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $

Callers 2

findlocalFunction · 0.85
getobjnameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected