** Process 1st operand 'v' of binary operation 'op' before reading ** 2nd operand. */
| 1084 | ** 2nd operand. |
| 1085 | */ |
| 1086 | void 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 | /* |
no test coverage detected