| 1038 | } |
| 1039 | } |
| 1040 | virtual RefPtr<ExpressionSyntaxNode> VisitImportExpression(ImportExpressionSyntaxNode * expr) override |
| 1041 | { |
| 1042 | variables.PushScope(); |
| 1043 | List<ILOperand*> arguments; |
| 1044 | int argIndex = 0; |
| 1045 | for (auto param : expr->ImportOperatorDef->GetParameters()) |
| 1046 | { |
| 1047 | expr->Arguments[argIndex]->Accept(this); |
| 1048 | auto argOp = PopStack(); |
| 1049 | arguments.Add(argOp); |
| 1050 | variables.Add(param->Name.Content, argOp); |
| 1051 | argIndex++; |
| 1052 | } |
| 1053 | currentImport = expr; |
| 1054 | auto oldTypeMapping = genericTypeMappings.TryGetValue(expr->ImportOperatorDef->TypeName.Content); |
| 1055 | auto componentType = TranslateExpressionType(expr->Type); |
| 1056 | genericTypeMappings[expr->ImportOperatorDef->TypeName.Content] = componentType; |
| 1057 | codeWriter.PushNode(); |
| 1058 | expr->ImportOperatorDef->Body->Accept(this); |
| 1059 | currentImport = nullptr; |
| 1060 | auto impInstr = new ImportInstruction(expr->Arguments.Count()); |
| 1061 | for (int i = 0; i < expr->Arguments.Count(); i++) |
| 1062 | impInstr->Arguments[i] = arguments[i]; |
| 1063 | impInstr->ImportOperator = codeWriter.PopNode(); |
| 1064 | variables.PopScope(); |
| 1065 | if (oldTypeMapping) |
| 1066 | genericTypeMappings[expr->ImportOperatorDef->TypeName.Content] = *oldTypeMapping; |
| 1067 | else |
| 1068 | genericTypeMappings.Remove(expr->ImportOperatorDef->TypeName.Content); |
| 1069 | impInstr->ComponentName = expr->ComponentUniqueName; |
| 1070 | impInstr->Type = TranslateExpressionType(expr->Type); |
| 1071 | codeWriter.Insert(impInstr); |
| 1072 | PushStack(impInstr); |
| 1073 | return expr; |
| 1074 | } |
| 1075 | virtual RefPtr<ExpressionSyntaxNode> VisitIndexExpression(IndexExpressionSyntaxNode* expr) override |
| 1076 | { |
| 1077 | expr->BaseExpression->Access = expr->Access; |
nothing calls this directly
no test coverage detected