** Apply prefix operation 'op' to expression 'e'. */
| 1853 | ** Apply prefix operation 'op' to expression 'e'. |
| 1854 | */ |
| 1855 | void luaK_prefix (FuncState *fs, UnOpr opr, expdesc *e, int line) { |
| 1856 | static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP, VT_ANY}; |
| 1857 | luaK_dischargevars(fs, e); |
| 1858 | switch (opr) { |
| 1859 | case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */ |
| 1860 | if (constfolding(fs, cast_int(opr + LUA_OPUNM), e, &ef)) |
| 1861 | break; |
| 1862 | /* else */ /* FALLTHROUGH */ |
| 1863 | case OPR_LEN: |
| 1864 | codeunexpval(fs, unopr2op(opr), e, line); |
| 1865 | break; |
| 1866 | case OPR_NOT: codenot(fs, e); break; |
| 1867 | default: lua_assert(0); |
| 1868 | } |
| 1869 | } |
| 1870 | |
| 1871 | |
| 1872 | /* |
no test coverage detected