MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / luaK_prefix

Function luaK_prefix

src/lcode.cpp:1855–1869  ·  view source on GitHub ↗

** Apply prefix operation 'op' to expression 'e'. */

Source from the content-addressed store, hash-verified

1853** Apply prefix operation 'op' to expression 'e'.
1854*/
1855void 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/*

Callers 1

subexprFunction · 0.85

Calls 5

luaK_dischargevarsFunction · 0.85
constfoldingFunction · 0.85
codeunexpvalFunction · 0.85
unopr2opFunction · 0.85
codenotFunction · 0.85

Tested by

no test coverage detected