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

Function adjustlocalvars

extlibs/lua/src/lparser.c:304–314  ·  view source on GitHub ↗

** Start the scope for the last 'nvars' created variables. */

Source from the content-addressed store, hash-verified

302** Start the scope for the last 'nvars' created variables.
303*/
304static void adjustlocalvars (LexState *ls, int nvars) {
305 FuncState *fs = ls->fs;
306 int stklevel = luaY_nvarstack(fs);
307 int i;
308 for (i = 0; i < nvars; i++) {
309 int varidx = fs->nactvar++;
310 Vardesc *var = getlocalvardesc(fs, varidx);
311 var->vd.sidx = stklevel++;
312 var->vd.pidx = registerlocalvar(ls, fs, var->vd.name);
313 }
314}
315
316
317/*

Callers 7

parlistFunction · 0.85
bodyFunction · 0.85
forbodyFunction · 0.85
fornumFunction · 0.85
forlistFunction · 0.85
localfuncFunction · 0.85
localstatFunction · 0.85

Calls 3

luaY_nvarstackFunction · 0.85
getlocalvardescFunction · 0.85
registerlocalvarFunction · 0.85

Tested by

no test coverage detected