** Apply prefix operation 'op' to expression 'e'. */
| 1614 | ** Apply prefix operation 'op' to expression 'e'. |
| 1615 | */ |
| 1616 | void luaK_prefix (FuncState *fs, UnOpr opr, expdesc *e, int line) { |
| 1617 | static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP}; |
| 1618 | luaK_dischargevars(fs, e); |
| 1619 | switch (opr) { |
| 1620 | case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */ |
| 1621 | if (constfolding(fs, opr + LUA_OPUNM, e, &ef)) |
| 1622 | break; |
| 1623 | /* else */ /* FALLTHROUGH */ |
| 1624 | case OPR_LEN: |
| 1625 | codeunexpval(fs, unopr2op(opr), e, line); |
| 1626 | break; |
| 1627 | case OPR_NOT: codenot(fs, e); break; |
| 1628 | default: lua_assert(0); |
| 1629 | } |
| 1630 | } |
| 1631 | |
| 1632 | |
| 1633 | /* |
no test coverage detected