From d7393955278c122bb718b333efbf6d3bda1c2864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Sun, 2 Jul 2017 12:18:56 +0200 Subject: [PATCH] bug fix #428 --- Compiler/PCU/PCUFileFormatVersion.cs | 2 +- Compiler/PCU/PCUReader.cs | 15 ++---------- Compiler/PCU/PCUWriter.cs | 1 + NETGenerator/NETGenerator.cs | 21 ++++++++++++++-- SemanticTree/SemanticTree.cs | 5 ++++ TestSuite/boxing1.pas | 10 ++++++++ TestSuite/units/u_boxing1.pas | 11 +++++++++ TestSuite/usesunits/use_boxing1.pas | 1 + .../convertion_data_and_alghoritms.cs | 9 +++++-- TreeConverter/TreeRealization/base_nodes.cs | 24 ++++++++++++++++++- 10 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 TestSuite/boxing1.pas create mode 100644 TestSuite/units/u_boxing1.pas create mode 100644 TestSuite/usesunits/use_boxing1.pas diff --git a/Compiler/PCU/PCUFileFormatVersion.cs b/Compiler/PCU/PCUFileFormatVersion.cs index dddfb3105..33af80b57 100644 --- a/Compiler/PCU/PCUFileFormatVersion.cs +++ b/Compiler/PCU/PCUFileFormatVersion.cs @@ -6,6 +6,6 @@ namespace PascalABCCompiler.PCU { public static class PCUFileFormatVersion { - public static System.Int16 Version = 106; + public static System.Int16 Version = 107; } } diff --git a/Compiler/PCU/PCUReader.cs b/Compiler/PCU/PCUReader.cs index beb432589..b18e7bcd1 100644 --- a/Compiler/PCU/PCUReader.cs +++ b/Compiler/PCU/PCUReader.cs @@ -3873,27 +3873,16 @@ namespace PascalABCCompiler.PCU private expression_node CreateBasicFunctionCall() { - /*SemanticTree.basic_function_type bft = (SemanticTree.basic_function_type)br.ReadInt16(); - type_node _tn = GetTypeReference(); - int num_param = br.ReadInt32(); - basic_function_node bfn = new basic_function_node(bft, _tn, true); - basic_function_call bfc = new basic_function_call(bfn, null); - bfc.ret_type=_tn; - for (int i = 0; i < num_param; i++) - { - expression_node expr=CreateExpression(); - bfc.parameters.AddElement(expr); - bfn.parameters.AddElement(new basic_parameter("p",expr.type, PascalABCCompiler.SemanticTree.parameter_type.value, bfn)); - } - return bfc;*/ SemanticTree.basic_function_type bft = (SemanticTree.basic_function_type)br.ReadInt16(); basic_function_node bfn = PascalABCCompiler.SystemLibrary.SystemLibrary.find_operator(bft); if (bfn == null) throw new CompilerInternalError("[PCUREADER] Function not defined: "+bft.ToString());//Console.WriteLine(bft); type_node _tn = GetTypeReference(); + type_node _conversion_tn = GetTypeReference(); br.ReadInt32(); basic_function_call bfc = new basic_function_call(bfn,null); bfc.ret_type = _tn; + bfc.conversion_type = _conversion_tn; int num_param = bfn.parameters.Count; for (int i=0; i private type_node _tn; - + + private type_node _conversion_tn; + /// /// Конструктор выражения. /// @@ -259,6 +261,18 @@ namespace PascalABCCompiler.TreeRealization _tn = value; } } + + public virtual type_node conversion_type + { + get + { + return _conversion_tn; + } + set + { + _conversion_tn = value; + } + } /// /// Обобщенный тип узла. @@ -303,6 +317,14 @@ namespace PascalABCCompiler.TreeRealization return this.type; } } + + SemanticTree.ITypeNode SemanticTree.IExpressionNode.conversion_type + { + get + { + return this.conversion_type; + } + } } [Serializable]