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

Function PrintFunction

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

Source from the content-addressed store, hash-verified

1527}
1528
1529std::string PrintFunction(GluaDecompileContextP ctx, Function* F) {
1530 auto &buff = F->decompiledCode;
1531 int indent = F->indent;
1532 PrintFunctionCheck(F);
1533
1534 clear_sstream(buff);
1535
1536 if (IsMain(ctx, F->f)) {
1537 buff << "-- params : " << F->funcBlock->code << "\n";
1538 PrintAstSub(ctx, F->funcBlock, buff, 0);
1539 }
1540 else {
1541 buff << "function(" << F->funcBlock->code << ")\n";
1542 PrintAstSub(ctx, F->funcBlock, buff, indent + 1);
1543 PrintIndent(buff, indent);
1544 buff << "end\n";
1545 }
1546
1547 return std::string(F->decompiledCode.str());
1548}
1549
1550/*
1551** -------------------------------------------------------------------------

Callers 1

ProcessCodeFunction · 0.70

Calls 6

PrintFunctionCheckFunction · 0.85
PrintAstSubFunction · 0.85
PrintIndentFunction · 0.85
clear_sstreamFunction · 0.70
stringClass · 0.50
strMethod · 0.45

Tested by

no test coverage detected