| 743 | return stmt; |
| 744 | } |
| 745 | virtual RefPtr<StatementSyntaxNode> VisitReturnStatement(ReturnStatementSyntaxNode* stmt) override |
| 746 | { |
| 747 | returnRegister = nullptr; |
| 748 | if (currentWorld != nullptr && currentComponent != nullptr && !currentImport) |
| 749 | { |
| 750 | if (stmt->Expression) |
| 751 | { |
| 752 | stmt->Expression->Accept(this); |
| 753 | returnRegister = PopStack(); |
| 754 | if (!currentComponent->SyntaxNode->IsComponentFunction()) |
| 755 | { |
| 756 | if (currentWorld->OutputType->Members.ContainsKey(currentComponent->UniqueName)) |
| 757 | { |
| 758 | auto exp = new ExportInstruction(currentComponent->UniqueName, currentWorld, returnRegister); |
| 759 | codeWriter.Insert(exp); |
| 760 | } |
| 761 | } |
| 762 | else |
| 763 | { |
| 764 | codeWriter.Insert(new ReturnInstruction(returnRegister)); |
| 765 | } |
| 766 | } |
| 767 | } |
| 768 | else |
| 769 | { |
| 770 | if (stmt->Expression) |
| 771 | { |
| 772 | stmt->Expression->Accept(this); |
| 773 | returnRegister = PopStack(); |
| 774 | } |
| 775 | codeWriter.Insert(new ReturnInstruction(returnRegister)); |
| 776 | } |
| 777 | return stmt; |
| 778 | } |
| 779 | virtual RefPtr<StatementSyntaxNode> VisitBreakStatement(BreakStatementSyntaxNode* stmt) override |
| 780 | { |
| 781 | codeWriter.Insert(new BreakInstruction()); |
nothing calls this directly
no test coverage detected