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

Function recfield

third-party/lua-5.4.6/src/lparser.c:847–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845
846
847static void recfield (LexState *ls, ConsControl *cc) {
848 /* recfield -> (NAME | '['exp']') = exp */
849 FuncState *fs = ls->fs;
850 int reg = ls->fs->freereg;
851 expdesc tab, key, val;
852 if (ls->t.token == TK_NAME)
853 codename(ls, &key);
854 else /* ls->t.token == '[' */
855 yindex(ls, &key);
856 checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
857 cc->nh++;
858 checknext(ls, '=');
859 tab = *cc->t;
860 luaK_indexed(fs, &tab, &key);
861 expr(ls, &val);
862 luaK_storevar(fs, &tab, &val);
863 fs->freereg = reg; /* free registers */
864}
865
866
867static void closelistfield (FuncState *fs, ConsControl *cc) {

Callers 1

fieldFunction · 0.70

Calls 7

codenameFunction · 0.70
yindexFunction · 0.70
checklimitFunction · 0.70
checknextFunction · 0.70
luaK_indexedFunction · 0.70
exprFunction · 0.70
luaK_storevarFunction · 0.70

Tested by

no test coverage detected