MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaK_infix

Function luaK_infix

depends/lua/src/lcode.c:1086–1115  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

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