MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / adjustlocalvars

Function adjustlocalvars

3rd/lua-5.4.3/src/lparser.c:311–321  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

309** Start the scope for the last 'nvars' created variables.
310*/
311static void adjustlocalvars (LexState *ls, int nvars) {
312 FuncState *fs = ls->fs;
313 int reglevel = luaY_nvarstack(fs);
314 int i;
315 for (i = 0; i < nvars; i++) {
316 int vidx = fs->nactvar++;
317 Vardesc *var = getlocalvardesc(fs, vidx);
318 var->vd.ridx = reglevel++;
319 var->vd.pidx = registerlocalvar(ls, fs, var->vd.name);
320 }
321}
322
323
324/*

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