** Apply prefix operation 'op' to expression 'e'. */
| 1569 | ** Apply prefix operation 'op' to expression 'e'. |
| 1570 | */ |
| 1571 | void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) { |
| 1572 | static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP}; |
| 1573 | luaK_dischargevars(fs, e); |
| 1574 | switch (op) { |
| 1575 | case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */ |
| 1576 | if (constfolding(fs, op + LUA_OPUNM, e, &ef)) |
| 1577 | break; |
| 1578 | /* else */ /* FALLTHROUGH */ |
| 1579 | case OPR_LEN: |
| 1580 | codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line); |
| 1581 | break; |
| 1582 | case OPR_NOT: codenot(fs, e); break; |
| 1583 | default: lua_assert(0); |
| 1584 | } |
| 1585 | } |
| 1586 | |
| 1587 | |
| 1588 | /* |
no test coverage detected