MCPcopy Create free account
hub / github.com/F-Stack/f-stack / recfield

Function recfield

freebsd/contrib/openzfs/module/lua/lparser.c:656–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

fieldFunction · 0.70

Calls 7

checklimitFunction · 0.85
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