| 1527 | } |
| 1528 | |
| 1529 | std::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 | ** ------------------------------------------------------------------------- |
no test coverage detected