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

Function recfield

extlibs/lua/src/lparser.c:828–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826
827
828static void recfield (LexState *ls, ConsControl *cc) {
829 /* recfield -> (NAME | '['exp']') = exp */
830 FuncState *fs = ls->fs;
831 int reg = ls->fs->freereg;
832 expdesc tab, key, val;
833 if (ls->t.token == TK_NAME) {
834 checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
835 codename(ls, &key);
836 }
837 else /* ls->t.token == '[' */
838 yindex(ls, &key);
839 cc->nh++;
840 checknext(ls, '=');
841 tab = *cc->t;
842 luaK_indexed(fs, &tab, &key);
843 expr(ls, &val);
844 luaK_storevar(fs, &tab, &val);
845 fs->freereg = reg; /* free registers */
846}
847
848
849static 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