| 631 | currentComponent = nullptr; |
| 632 | } |
| 633 | virtual RefPtr<FunctionSyntaxNode> VisitFunction(FunctionSyntaxNode* function) override |
| 634 | { |
| 635 | if (function->IsExtern()) |
| 636 | return function; |
| 637 | RefPtr<ILFunction> func = new ILFunction(); |
| 638 | result.Program->Functions.Add(function->InternalName, func); |
| 639 | func->Name = function->InternalName; |
| 640 | func->ReturnType = TranslateExpressionType(function->ReturnType); |
| 641 | variables.PushScope(); |
| 642 | codeWriter.PushNode(); |
| 643 | int id = 0; |
| 644 | for (auto ¶m : function->GetParameters()) |
| 645 | { |
| 646 | func->Parameters.Add(param->Name.Content, ILParameter(TranslateExpressionType(param->Type), GetParamQualifier(param.Ptr()))); |
| 647 | auto op = FetchArg(param->Type.Ptr(), ++id); |
| 648 | op->Name = EscapeCodeName(String("p_") + param->Name.Content); |
| 649 | variables.Add(param->Name.Content, op); |
| 650 | } |
| 651 | function->Body->Accept(this); |
| 652 | func->Code = codeWriter.PopNode(); |
| 653 | variables.PopScope(); |
| 654 | return function; |
| 655 | } |
| 656 | virtual RefPtr<StatementSyntaxNode> VisitBlockStatement(BlockStatementSyntaxNode* stmt) override |
| 657 | { |
| 658 | variables.PushScope(); |
nothing calls this directly
no test coverage detected