MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaK_prefix

Function luaK_prefix

deps/lua/src/lcode.c:689–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687
688
689void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) {
690 expdesc e2;
691 e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0;
692 switch (op) {
693 case OPR_MINUS: {
694 if (!isnumeral(e))
695 luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */
696 codearith(fs, OP_UNM, e, &e2);
697 break;
698 }
699 case OPR_NOT: codenot(fs, e); break;
700 case OPR_LEN: {
701 luaK_exp2anyreg(fs, e); /* cannot operate on constants */
702 codearith(fs, OP_LEN, e, &e2);
703 break;
704 }
705 default: lua_assert(0);
706 }
707}
708
709
710void 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