MCPcopy Create free account
hub / github.com/Cubitect/cubiomes-viewer / luaK_prefix

Function luaK_prefix

lua/src/lcode.c:1571–1585  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1569** Apply prefix operation 'op' to expression 'e'.
1570*/
1571void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) {
1572 static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP};
1573 luaK_dischargevars(fs, e);
1574 switch (op) {
1575 case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */
1576 if (constfolding(fs, op + LUA_OPUNM, e, &ef))
1577 break;
1578 /* else */ /* FALLTHROUGH */
1579 case OPR_LEN:
1580 codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line);
1581 break;
1582 case OPR_NOT: codenot(fs, e); break;
1583 default: lua_assert(0);
1584 }
1585}
1586
1587
1588/*

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