MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaK_infix

Function luaK_infix

libraries/AP_Scripting/lua/src/lcode.c:1093–1122  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

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