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

Function recfield

third-party/lua-5.3.5/src/lparser.c:646–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644
645
646static void recfield (LexState *ls, struct ConsControl *cc) {
647 /* recfield -> (NAME | '['exp1']') = exp1 */
648 FuncState *fs = ls->fs;
649 int reg = ls->fs->freereg;
650 expdesc key, val;
651 int rkkey;
652 if (ls->t.token == TK_NAME) {
653 checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
654 checkname(ls, &key);
655 }
656 else /* ls->t.token == '[' */
657 yindex(ls, &key);
658 cc->nh++;
659 checknext(ls, '=');
660 rkkey = luaK_exp2RK(fs, &key);
661 expr(ls, &val);
662 luaK_codeABC(fs, OP_SETTABLE, cc->t->u.info, rkkey, luaK_exp2RK(fs, &val));
663 fs->freereg = reg; /* free registers */
664}
665
666
667static void closelistfield (FuncState *fs, struct ConsControl *cc) {

Callers 1

fieldFunction · 0.70

Calls 7

checklimitFunction · 0.70
checknameFunction · 0.70
yindexFunction · 0.70
checknextFunction · 0.70
luaK_exp2RKFunction · 0.70
exprFunction · 0.70
luaK_codeABCFunction · 0.70

Tested by

no test coverage detected