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

Function registerlocalvar

depends/lua/src/lparser.c:161–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159
160
161static int registerlocalvar (LexState *ls, TString *varname) {
162 FuncState *fs = ls->fs;
163 Proto *f = fs->f;
164 int oldsize = f->sizelocvars;
165 luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars,
166 LocVar, SHRT_MAX, "local variables");
167 while (oldsize < f->sizelocvars)
168 f->locvars[oldsize++].varname = NULL;
169 f->locvars[fs->nlocvars].varname = varname;
170 luaC_objbarrier(ls->L, f, varname);
171 return fs->nlocvars++;
172}
173
174
175static void new_localvar (LexState *ls, TString *name) {

Callers 1

new_localvarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected