MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaK_prefix

Function luaK_prefix

libraries/AP_Scripting/lua/src/lcode.c:1073–1086  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

subexprFunction · 0.85

Calls 3

constfoldingFunction · 0.85
codeunexpvalFunction · 0.85
codenotFunction · 0.85

Tested by

no test coverage detected