** Apply prefix operation 'op' to expression 'e'. */
| 1064 | ** Apply prefix operation 'op' to expression 'e'. |
| 1065 | */ |
| 1066 | void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) { |
| 1067 | static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP}; |
| 1068 | switch (op) { |
| 1069 | case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */ |
| 1070 | if (constfolding(fs, op + LUA_OPUNM, e, &ef)) |
| 1071 | break; |
| 1072 | /* FALLTHROUGH */ |
| 1073 | case OPR_LEN: |
| 1074 | codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line); |
| 1075 | break; |
| 1076 | case OPR_NOT: codenot(fs, e); break; |
| 1077 | default: lua_assert(0); |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | |
| 1082 | /* |
no test coverage detected