lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


What dose recfield stand for?
Or what is the meaning of 'rec'?


static void recfield (LexState *ls, struct ConsControl *cc) {
 /* recfield -> (NAME | `['exp1`]') = exp1 */
 FuncState *fs = ls->fs;
 int reg = ls->fs->freereg;
 expdesc key, val;
 if (ls->t.token == TK_NAME) {
   luaY_checklimit(fs, cc->nh, MAX_INT, "items in a constructor");
   checkname(ls, &key);
 }
 else  /* ls->t.token == '[' */
   yindex(ls, &key);
 cc->nh++;
 checknext(ls, '=');
 luaK_exp2RK(fs, &key);
 expr(ls, &val);
 luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, luaK_exp2RK(fs, &key),
                                                luaK_exp2RK(fs, &val));
 fs->freereg = reg;  /* free registers */
}