MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaK_prefix

Function luaK_prefix

depends/lua/src/lcode.c:1066–1079  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1064** Apply prefix operation 'op' to expression 'e'.
1065*/
1066void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) {
1067 static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP};
1068 switch (op) {
1069 case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */
1070 if (constfolding(fs, op + LUA_OPUNM, e, &ef))
1071 break;
1072 /* FALLTHROUGH */
1073 case OPR_LEN:
1074 codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line);
1075 break;
1076 case OPR_NOT: codenot(fs, e); break;
1077 default: lua_assert(0);
1078 }
1079}
1080
1081
1082/*

Callers 1

subexprFunction · 0.85

Calls 4

constfoldingFunction · 0.85
codeunexpvalFunction · 0.85
castFunction · 0.85
codenotFunction · 0.85

Tested by

no test coverage detected