MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / PrintLogicItem

Function PrintLogicItem

src/Chain/libraries/glua/glua_decompile.cpp:461–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461void PrintLogicItem(std::stringstream &str, LogicExp* exp, int inv, int rev) {
462 if (exp->subexp) {
463 str << "(";
464 PrintLogicExp(str, exp->dest, exp->subexp, inv, rev);
465 str << ")";
466 }
467 else {
468 char* op;
469 int cond = exp->neg;
470 if (inv) cond = !cond;
471 if (rev) cond = !cond;
472 if (cond) {
473 op = (char*)invopstr(exp->op);
474 }
475 else {
476 op = (char*)opstr(exp->op);
477 }
478 if ((exp->op != OP_TEST) && (exp->op != OP_TESTSET)) {
479 str << exp->op1 << " " << op << " " << exp->op2;
480 }
481 else if (op) {
482 str << op << " " << exp->op2;
483 }
484 else {
485 str << exp->op2;
486 }
487 }
488}
489
490void PrintLogicExp(std::stringstream &str, int dest, LogicExp* exp, int inv_, int rev) {
491 int inv = inv_;

Callers 1

PrintLogicExpFunction · 0.85

Calls 1

PrintLogicExpFunction · 0.85

Tested by

no test coverage detected