MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / recfield

Function recfield

lib/lua/src/lparser.c:847–865  ·  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 checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
854 codename(ls, &key);
855 }
856 else /* ls->t.token == '[' */
857 yindex(ls, &key);
858 cc->nh++;
859 checknext(ls, '=');
860 tab = *cc->t;
861 luaK_indexed(fs, &tab, &key);
862 expr(ls, &val);
863 luaK_storevar(fs, &tab, &val);
864 fs->freereg = reg; /* free registers */
865}
866
867
868static void closelistfield (FuncState *fs, ConsControl *cc) {

Callers 1

fieldFunction · 0.85

Calls 7

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

Tested by

no test coverage detected