** Apply prefix operation 'op' to expression 'e'. */
| 1551 | ** Apply prefix operation 'op' to expression 'e'. |
| 1552 | */ |
| 1553 | void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) { |
| 1554 | static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP}; |
| 1555 | luaK_dischargevars(fs, e); |
| 1556 | switch (op) { |
| 1557 | case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */ |
| 1558 | if (constfolding(fs, op + LUA_OPUNM, e, &ef)) |
| 1559 | break; |
| 1560 | /* else */ /* FALLTHROUGH */ |
| 1561 | case OPR_LEN: |
| 1562 | codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line); |
| 1563 | break; |
| 1564 | case OPR_NOT: codenot(fs, e); break; |
| 1565 | default: lua_assert(0); |
| 1566 | } |
| 1567 | } |
| 1568 | |
| 1569 | |
| 1570 | /* |
no test coverage detected