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

Function recfield

third-party/lua-5.2.4/src/lparser.c:652–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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