MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / adjustlocalvars

Function adjustlocalvars

third-party/lua-5.5.0/src/lparser.c:328–339  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

326** Start the scope for the last 'nvars' created variables.
327*/
328static void adjustlocalvars (LexState *ls, int nvars) {
329 FuncState *fs = ls->fs;
330 int reglevel = luaY_nvarstack(fs);
331 int i;
332 for (i = 0; i < nvars; i++) {
333 int vidx = fs->nactvar++;
334 Vardesc *var = getlocalvardesc(fs, vidx);
335 var->vd.ridx = cast_byte(reglevel++);
336 var->vd.pidx = registerlocalvar(ls, fs, var->vd.name);
337 luaY_checklimit(fs, reglevel, MAXVARS, "local variables");
338 }
339}
340
341
342/*

Callers 7

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

Calls 4

luaY_checklimitFunction · 0.85
luaY_nvarstackFunction · 0.70
getlocalvardescFunction · 0.70
registerlocalvarFunction · 0.70

Tested by

no test coverage detected