MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaK_prefix

Function luaK_prefix

extlibs/lua/src/lcode.c:1553–1567  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1551** Apply prefix operation 'op' to expression 'e'.
1552*/
1553void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) {
1554 static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP};
1555 luaK_dischargevars(fs, e);
1556 switch (op) {
1557 case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */
1558 if (constfolding(fs, op + LUA_OPUNM, e, &ef))
1559 break;
1560 /* else */ /* FALLTHROUGH */
1561 case OPR_LEN:
1562 codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line);
1563 break;
1564 case OPR_NOT: codenot(fs, e); break;
1565 default: lua_assert(0);
1566 }
1567}
1568
1569
1570/*

Callers 1

subexprFunction · 0.85

Calls 4

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

Tested by

no test coverage detected