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

Function luaK_prefix

Source/Misc/lua/src/lua.c:4366–4384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4364
4365
4366void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) {
4367expdesc e2;
4368e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0;
4369switch (op) {
4370case OPR_MINUS: {
4371if (!isnumeral(e))
4372luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */
4373codearith(fs, OP_UNM, e, &e2);
4374break;
4375}
4376case OPR_NOT: codenot(fs, e); break;
4377case OPR_LEN: {
4378luaK_exp2anyreg(fs, e); /* cannot operate on constants */
4379codearith(fs, OP_LEN, e, &e2);
4380break;
4381}
4382default: lua_assert(0);
4383}
4384}
4385
4386
4387void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) {

Callers 1

subexprFunction · 0.85

Calls 4

isnumeralFunction · 0.85
luaK_exp2anyregFunction · 0.85
codearithFunction · 0.85
codenotFunction · 0.85

Tested by

no test coverage detected