MCPcopy Create free account
hub / github.com/Tencent/sluaunreal / luaK_infix

Function luaK_infix

Plugins/slua_unreal/External/lua/lcode.cpp:1084–1113  ·  view source on GitHub ↗

** Process 1st operand 'v' of binary operation 'op' before reading ** 2nd operand. */

Source from the content-addressed store, hash-verified

1082** 2nd operand.
1083*/
1084void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) {
1085 switch (op) {
1086 case OPR_AND: {
1087 luaK_goiftrue(fs, v); /* go ahead only if 'v' is true */
1088 break;
1089 }
1090 case OPR_OR: {
1091 luaK_goiffalse(fs, v); /* go ahead only if 'v' is false */
1092 break;
1093 }
1094 case OPR_CONCAT: {
1095 luaK_exp2nextreg(fs, v); /* operand must be on the 'stack' */
1096 break;
1097 }
1098 case OPR_ADD: case OPR_SUB:
1099 case OPR_MUL: case OPR_DIV: case OPR_IDIV:
1100 case OPR_MOD: case OPR_POW:
1101 case OPR_BAND: case OPR_BOR: case OPR_BXOR:
1102 case OPR_SHL: case OPR_SHR: {
1103 if (!tonumeral(v, NULL))
1104 luaK_exp2RK(fs, v);
1105 /* else keep numeral, which may be folded with 2nd operand */
1106 break;
1107 }
1108 default: {
1109 luaK_exp2RK(fs, v);
1110 break;
1111 }
1112 }
1113}
1114
1115
1116/*

Callers 1

subexprFunction · 0.85

Calls 5

luaK_goiftrueFunction · 0.85
luaK_goiffalseFunction · 0.85
luaK_exp2nextregFunction · 0.85
tonumeralFunction · 0.85
luaK_exp2RKFunction · 0.85

Tested by

no test coverage detected