MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / recfield

Function recfield

src/Chain/libraries/glua/lparser.cpp:674–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

672
673
674static void recfield(LexState *ls, struct ConsControl *cc) {
675 /* recfield -> (NAME | '['exp1']') = exp1 */
676 FuncState *fs = ls->fs;
677 int reg = ls->fs->freereg;
678 expdesc key, val;
679 int rkkey;
680 if (ls->t.token == TK_NAME) {
681 checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
682 checkname(ls, &key);
683 }
684 else /* ls->t.token == '[' */
685 yindex(ls, &key);
686 cc->nh++;
687 checknext(ls, '=');
688 rkkey = luaK_exp2RK(fs, &key);
689 expr(ls, &val);
690 luaK_codeABC(fs, OP_SETTABLE, cc->t->u.info, rkkey, luaK_exp2RK(fs, &val));
691 fs->freereg = reg; /* free registers */
692}
693
694
695static void closelistfield(FuncState *fs, struct ConsControl *cc) {

Callers 1

fieldFunction · 0.85

Calls 7

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

Tested by

no test coverage detected