MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaK_exp2RK

Function luaK_exp2RK

Source/Misc/lua/src/lua.c:4113–4138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4111
4112
4113int luaK_exp2RK (FuncState *fs, expdesc *e) {
4114luaK_exp2val(fs, e);
4115switch (e->k) {
4116case VKNUM:
4117case VTRUE:
4118case VFALSE:
4119case VNIL: {
4120if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */
4121e->u.s.info = (e->k == VNIL) ? nilK(fs) :
4122(e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) :
4123boolK(fs, (e->k == VTRUE));
4124e->k = VK;
4125return RKASK(e->u.s.info);
4126}
4127else break;
4128}
4129case VK: {
4130if (e->u.s.info <= MAXINDEXRK) /* constant fit in argC? */
4131return RKASK(e->u.s.info);
4132else break;
4133}
4134default: break;
4135}
4136/* not a constant in the right range: put it in a register */
4137return luaK_exp2anyreg(fs, e);
4138}
4139
4140
4141void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) {

Callers 7

luaK_storevarFunction · 0.85
luaK_selfFunction · 0.85
luaK_indexedFunction · 0.85
codearithFunction · 0.85
codecompFunction · 0.85
luaK_infixFunction · 0.85
recfieldFunction · 0.85

Calls 5

luaK_exp2valFunction · 0.85
nilKFunction · 0.85
luaK_numberKFunction · 0.85
boolKFunction · 0.85
luaK_exp2anyregFunction · 0.85

Tested by

no test coverage detected