В стандартной библиотеке все имена Indexes заменены на Indices

This commit is contained in:
Mikhalkovich Stanislav 2019-02-06 19:50:05 +03:00
parent bd2e627939
commit bea912377e
3 changed files with 16 additions and 20 deletions

View file

@ -225,6 +225,10 @@ namespace PascalABCCompiler.NetHelper
}
return null;
}
public override string ToString()
{
return Assembly.ToString();
}
}
public class NetTypeScope : SymbolTable.DotNETScope {

View file

@ -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;

View file

@ -9663,18 +9663,15 @@ end;
procedure SetCol<T>(Self: array [,] of T; k: integer; a: sequence of T); extensionmethod := Self.SetCol(k,a.ToArray);
/// Возвращает по заданному двумерному массиву последовательность (a[i,j],i,j)
function ElementsWithIndexes<T>(Self: array [,] of T): sequence of (T, integer, integer); extensionmethod;
function ElementsWithIndices<T>(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<T>(Self: array [,] of T): sequence of (T, integer, integer); extensionmethod := Self.ElementsWithIndexes;
/// Возвращает по заданному двумерному массиву последовательность индексов элементов, удовлетворяющих заданному условию
function IndexesOf<T>(Self: array [,] of T; cond: T -> boolean): sequence of (integer, integer); extensionmethod;
function Indices<T>(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<T>(Self: array [,] of T; cond: T -> boolean): sequence of (integer, integer); extensionmethod := Self.IndexesOf(cond);
/// Возвращает по заданному двумерному массиву последовательность его элементов по строкам
function ElementsByRow<T>(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<T>(Self: array of T): sequence of integer; extensionmethod := Range(0, Self.Length - 1);
/// Возвращает последовательность индексов одномерного массива
function Indices<T>(Self: array of T): sequence of integer; extensionmethod := Self.Indexes;
function Indices<T>(Self: array of T): sequence of integer; extensionmethod := Range(0, Self.Length - 1);
/// Возвращает последовательность индексов элементов одномерного массива, удовлетворяющих условию
function IndexesOf<T>(Self: array of T; cond: T->boolean): sequence of integer; extensionmethod;
function Indices<T>(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<T>(Self: array of T; cond: T->boolean): sequence of integer; extensionmethod := Self.IndexesOf(cond);
/// Возвращает последовательность индексов элементов одномерного массива, удовлетворяющих условию
function IndexesOf<T>(Self: array of T; cond: (T,integer) ->boolean): sequence of integer; extensionmethod;
function Indices<T>(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<T>(Self: array of T; cond: (T,integer) ->boolean): sequence of integer; extensionmethod := Self.IndexesOf(cond);
///--
function CreateSliceFromArrayInternal<T>(Self: array of T; from, step, count: integer): array of T;
begin