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