From bea912377ec700da172417eaedf1770fc4a84bfe Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Wed, 6 Feb 2019 19:50:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=20=D1=81=D1=82=D0=B0=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D1=82=D0=BD=D0=BE=D0=B9=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8?= =?UTF-8?q?=D0=BE=D1=82=D0=B5=D0=BA=D0=B5=20=D0=B2=D1=81=D0=B5=20=D0=B8?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B0=20Indexes=20=D0=B7=D0=B0=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D1=8B=20=D0=BD=D0=B0=20Indices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TreeConverter/NetWrappers/NetHelper.cs | 4 +++ .../convertion_data_and_alghoritms.cs | 7 ++++++ bin/Lib/PABCSystem.pas | 25 ++++--------------- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/TreeConverter/NetWrappers/NetHelper.cs b/TreeConverter/NetWrappers/NetHelper.cs index a40977fb9..908da96c5 100644 --- a/TreeConverter/NetWrappers/NetHelper.cs +++ b/TreeConverter/NetWrappers/NetHelper.cs @@ -225,6 +225,10 @@ namespace PascalABCCompiler.NetHelper } return null; } + public override string ToString() + { + return Assembly.ToString(); + } } public class NetTypeScope : SymbolTable.DotNETScope { diff --git a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs index 39f8784a9..ed825cee8 100644 --- a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs +++ b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs @@ -816,6 +816,13 @@ namespace PascalABCCompiler.TreeConverter { return true; } + /*var comptn1 = t1 as compiled_type_node; + var comptn2 = t2 as compiled_type_node; + if (comptn1 != null && comptn2 != null) + { + if (comptn1.compiled_type == comptn2.compiled_type) // увы - тут типы Type разные и хеш-коды у них разные + return true; + } */ if (!t1.depended_from_indefinite && !t2.depended_from_indefinite) { return false; diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index 586a8521b..b8db1adf7 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -9663,18 +9663,15 @@ end; procedure SetCol(Self: array [,] of T; k: integer; a: sequence of T); extensionmethod := Self.SetCol(k,a.ToArray); /// Возвращает по заданному двумерному массиву последовательность (a[i,j],i,j) -function ElementsWithIndexes(Self: array [,] of T): sequence of (T, integer, integer); extensionmethod; +function ElementsWithIndices(Self: array [,] of T): sequence of (T, integer, integer); extensionmethod; begin for var i := 0 to Self.RowCount - 1 do for var j := 0 to Self.ColCount - 1 do yield (Self[i, j], i, j) end; -/// Возвращает по заданному двумерному массиву последовательность (a[i,j],i,j) -function ElementsWithIndices(Self: array [,] of T): sequence of (T, integer, integer); extensionmethod := Self.ElementsWithIndexes; - /// Возвращает по заданному двумерному массиву последовательность индексов элементов, удовлетворяющих заданному условию -function IndexesOf(Self: array [,] of T; cond: T -> boolean): sequence of (integer, integer); extensionmethod; +function Indices(Self: array [,] of T; cond: T -> boolean): sequence of (integer, integer); extensionmethod; begin for var i := 0 to Self.RowCount - 1 do for var j := 0 to Self.ColCount - 1 do @@ -9682,9 +9679,6 @@ begin yield (i, j) end; -/// Возвращает по заданному двумерному массиву последовательность индексов элементов, удовлетворяющих заданному условию -function IndicesOf(Self: array [,] of T; cond: T -> boolean): sequence of (integer, integer); extensionmethod := Self.IndexesOf(cond); - /// Возвращает по заданному двумерному массиву последовательность его элементов по строкам function ElementsByRow(Self: array [,] of T): sequence of T; extensionmethod; begin @@ -10145,13 +10139,10 @@ function High(Self: System.Array); extensionmethod := High(Self); function Low(Self: System.Array); extensionmethod := Low(Self); /// Возвращает последовательность индексов одномерного массива -function Indexes(Self: array of T): sequence of integer; extensionmethod := Range(0, Self.Length - 1); - -/// Возвращает последовательность индексов одномерного массива -function Indices(Self: array of T): sequence of integer; extensionmethod := Self.Indexes; +function Indices(Self: array of T): sequence of integer; extensionmethod := Range(0, Self.Length - 1); /// Возвращает последовательность индексов элементов одномерного массива, удовлетворяющих условию -function IndexesOf(Self: array of T; cond: T->boolean): sequence of integer; extensionmethod; +function Indices(Self: array of T; cond: T->boolean): sequence of integer; extensionmethod; begin for var i := 0 to Self.High do if cond(Self[i]) then @@ -10159,19 +10150,13 @@ begin end; /// Возвращает последовательность индексов элементов одномерного массива, удовлетворяющих условию -function IndicesOf(Self: array of T; cond: T->boolean): sequence of integer; extensionmethod := Self.IndexesOf(cond); - -/// Возвращает последовательность индексов элементов одномерного массива, удовлетворяющих условию -function IndexesOf(Self: array of T; cond: (T,integer) ->boolean): sequence of integer; extensionmethod; +function Indices(Self: array of T; cond: (T,integer) ->boolean): sequence of integer; extensionmethod; begin for var i := 0 to Self.High do if cond(Self[i], i) then yield i; end; -/// Возвращает последовательность индексов элементов одномерного массива, удовлетворяющих условию -function IndicesOf(Self: array of T; cond: (T,integer) ->boolean): sequence of integer; extensionmethod := Self.IndexesOf(cond); - ///-- function CreateSliceFromArrayInternal(Self: array of T; from, step, count: integer): array of T; begin