MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaK_prefix

Function luaK_prefix

third-party/lua-5.4.6/src/lcode.c:1616–1630  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1614** Apply prefix operation 'op' to expression 'e'.
1615*/
1616void 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/*

Callers 1

subexprFunction · 0.70

Calls 5

luaK_dischargevarsFunction · 0.70
constfoldingFunction · 0.70
codeunexpvalFunction · 0.70
unopr2opFunction · 0.70
codenotFunction · 0.70

Tested by

no test coverage detected