MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaK_prefix

Function luaK_prefix

lib/lua/src/lcode.c:1615–1629  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

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