NS2
This commit is contained in:
parent
591d9ebe60
commit
f8819665ba
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "10";
|
||||
public const string Build = "0";
|
||||
public const string Revision = "3565";
|
||||
public const string Revision = "3569";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%MINOR%=10
|
||||
%REVISION%=3565
|
||||
%REVISION%=3569
|
||||
%COREVERSION%=0
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
3.10.0.3565
|
||||
3.10.0.3569
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.10.0.3565'
|
||||
!define VERSION '3.10.0.3569'
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ end;
|
|||
// Важнейший для новых множеств !!!
|
||||
{procedure operator:=<T>(var Self: NewSet<T>; st: NewSet<T>); extensionmethod;
|
||||
begin
|
||||
Self.hs := new HashSet<T>(st.hs);
|
||||
Self._hs := new HashSet<T>(st.hs);
|
||||
end;}
|
||||
|
||||
{procedure operator:=<T>(var Self: NewSet<T>; st: NewSetEmpty); extensionmethod;
|
||||
|
|
@ -468,89 +468,89 @@ end;}
|
|||
// Extension-методы для новых множеств
|
||||
function operator implicit(n: NewSet<integer>): NewSet<byte>; extensionmethod;
|
||||
begin
|
||||
foreach var x in n.hs do
|
||||
foreach var x in n._hs do
|
||||
if (x >= byte.MinValue) and (x <= byte.MaxValue) then
|
||||
Result.hs.Add(x)
|
||||
Result._hs.Add(x)
|
||||
else raise new System.ArgumentException(GetTranslation(OUT_OF_TYPE_RANGE_IN_SET_ASSIGNMENT));
|
||||
end;
|
||||
|
||||
function operator implicit(n: NewSet<integer>): NewSet<shortint>; extensionmethod;
|
||||
begin
|
||||
foreach var x in n.hs do
|
||||
foreach var x in n._hs do
|
||||
if (x >= shortint.MinValue) and (x <= shortint.MaxValue) then
|
||||
Result.hs.Add(x)
|
||||
Result._hs.Add(x)
|
||||
else raise new System.ArgumentException(GetTranslation(OUT_OF_TYPE_RANGE_IN_SET_ASSIGNMENT));
|
||||
end;
|
||||
|
||||
function operator implicit(n: NewSet<integer>): NewSet<smallint>; extensionmethod;
|
||||
begin
|
||||
foreach var x in n.hs do
|
||||
foreach var x in n._hs do
|
||||
if (x >= smallint.MinValue) and (x <= smallint.MaxValue) then
|
||||
Result.hs.Add(x)
|
||||
Result._hs.Add(x)
|
||||
else raise new System.ArgumentException(GetTranslation(OUT_OF_TYPE_RANGE_IN_SET_ASSIGNMENT));
|
||||
end;
|
||||
|
||||
function operator implicit(n: NewSet<integer>): NewSet<word>; extensionmethod;
|
||||
begin
|
||||
foreach var x in n.hs do
|
||||
foreach var x in n._hs do
|
||||
if (x >= word.MinValue) and (x <= word.MaxValue) then
|
||||
Result.hs.Add(x)
|
||||
Result._hs.Add(x)
|
||||
else raise new System.ArgumentException(GetTranslation(OUT_OF_TYPE_RANGE_IN_SET_ASSIGNMENT));
|
||||
end;
|
||||
|
||||
function operator implicit(n: NewSet<integer>): NewSet<longword>; extensionmethod;
|
||||
begin
|
||||
foreach var x in n.hs do
|
||||
foreach var x in n._hs do
|
||||
if (x >= longword.MinValue) and (x <= longword.MaxValue) then
|
||||
Result.hs.Add(x)
|
||||
Result._hs.Add(x)
|
||||
else raise new System.ArgumentException(GetTranslation(OUT_OF_TYPE_RANGE_IN_SET_ASSIGNMENT));
|
||||
end;
|
||||
|
||||
function operator implicit(n: NewSet<integer>): NewSet<int64>; extensionmethod;
|
||||
begin
|
||||
foreach var x in n.hs do
|
||||
Result.hs.Add(x)
|
||||
foreach var x in n._hs do
|
||||
Result._hs.Add(x)
|
||||
end;
|
||||
|
||||
function operator implicit(n: NewSet<integer>): NewSet<uint64>; extensionmethod;
|
||||
begin
|
||||
foreach var x in n.hs do
|
||||
foreach var x in n._hs do
|
||||
if x >= 0 then
|
||||
Result.hs.Add(x)
|
||||
Result._hs.Add(x)
|
||||
else raise new System.ArgumentException(GetTranslation(OUT_OF_TYPE_RANGE_IN_SET_ASSIGNMENT));
|
||||
end;
|
||||
|
||||
function NSToInts(ns: NewSet<byte>) := ns.hs.Select(x -> integer(x));
|
||||
function NSToInts(ns: NewSet<shortint>) := ns.hs.Select(x -> integer(x));
|
||||
function NSToInts(ns: NewSet<smallint>) := ns.hs.Select(x -> integer(x));
|
||||
function NSToInts(ns: NewSet<word>) := ns.hs.Select(x -> integer(x));
|
||||
function NSToInts(ns: NewSet<byte>) := ns._hs.Select(x -> integer(x));
|
||||
function NSToInts(ns: NewSet<shortint>) := ns._hs.Select(x -> integer(x));
|
||||
function NSToInts(ns: NewSet<smallint>) := ns._hs.Select(x -> integer(x));
|
||||
function NSToInts(ns: NewSet<word>) := ns._hs.Select(x -> integer(x));
|
||||
//function NSToInts(ns: NewSet<longword>) := ns._hs.Select(x -> integer(x));
|
||||
//function NSToInts(ns: NewSet<int64>) := ns._hs.Select(x -> integer(x));
|
||||
function NSToInts64(ns: NewSet<byte>) := ns.hs.Select(x -> int64(x));
|
||||
function NSToInts64(ns: NewSet<integer>) := ns.hs.Select(x -> int64(x));
|
||||
function NSToBytes(ns: NewSet<integer>) := ns.hs.Select(x -> byte(x));
|
||||
function NSToBytes(ns: NewSet<int64>) := ns.hs.Select(x -> byte(x));
|
||||
function NSToInts64(ns: NewSet<byte>) := ns._hs.Select(x -> int64(x));
|
||||
function NSToInts64(ns: NewSet<integer>) := ns._hs.Select(x -> int64(x));
|
||||
function NSToBytes(ns: NewSet<integer>) := ns._hs.Select(x -> byte(x));
|
||||
function NSToBytes(ns: NewSet<int64>) := ns._hs.Select(x -> byte(x));
|
||||
|
||||
// Надо set of integer со всеми
|
||||
function operator=(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a.hs.SetEquals(NSToInts(b));
|
||||
function operator=(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a._hs.SetEquals(NSToInts(b));
|
||||
function operator=(a: NewSet<byte>; b: NewSet<integer>): boolean; extensionmethod := b = a;
|
||||
function operator=(a: NewSet<integer>; b: NewSet<shortint>); extensionmethod := a.hs.SetEquals(NSToInts(b));
|
||||
function operator=(a: NewSet<integer>; b: NewSet<shortint>); extensionmethod := a._hs.SetEquals(NSToInts(b));
|
||||
function operator=(a: NewSet<shortint>; b: NewSet<integer>): boolean; extensionmethod := b = a;
|
||||
function operator=(a: NewSet<integer>; b: NewSet<smallint>); extensionmethod := a.hs.SetEquals(NSToInts(b));
|
||||
function operator=(a: NewSet<integer>; b: NewSet<smallint>); extensionmethod := a._hs.SetEquals(NSToInts(b));
|
||||
function operator=(a: NewSet<smallint>; b: NewSet<integer>): boolean; extensionmethod := b = a;
|
||||
function operator=(a: NewSet<integer>; b: NewSet<word>); extensionmethod := a.hs.SetEquals(NSToInts(b));
|
||||
function operator=(a: NewSet<integer>; b: NewSet<word>); extensionmethod := a._hs.SetEquals(NSToInts(b));
|
||||
function operator=(a: NewSet<word>; b: NewSet<integer>): boolean; extensionmethod := b = a;
|
||||
|
||||
// В этом случае integer и longword не вкладываются друг в друга
|
||||
function operator=(a: NewSet<integer>; b: NewSet<longword>): boolean; extensionmethod;
|
||||
begin
|
||||
var hsInt64: HashSet<int64>;
|
||||
hsInt64 := new HashSet<int64>(b.hs.Select(x -> int64(x)));
|
||||
Result := hsInt64.SetEquals(a.hs.Select(x -> int64(x)));
|
||||
hsInt64 := new HashSet<int64>(b._hs.Select(x -> int64(x)));
|
||||
Result := hsInt64.SetEquals(a._hs.Select(x -> int64(x)));
|
||||
end;
|
||||
|
||||
function operator=(a: NewSet<longword>; b: NewSet<integer>): boolean; extensionmethod := b = a;
|
||||
function operator=(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a.hs.SetEquals(NSToInts64(b));
|
||||
function operator=(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a._hs.SetEquals(NSToInts64(b));
|
||||
function operator=(a: NewSet<integer>; b: NewSet<int64>): boolean; extensionmethod := b = a;
|
||||
|
||||
// Здесь оба типа нельзя расширить до общего типа, и есть проблема
|
||||
|
|
@ -582,43 +582,43 @@ function operator<>(a: NewSet<integer>; b: NewSet<int64>); extensionmethod := no
|
|||
function operator<>(a: NewSet<integer>; b: NewSet<uint64>); extensionmethod := not(a = b);
|
||||
function operator<>(a: NewSet<uint64>; b: NewSet<integer>); extensionmethod := not(a = b);
|
||||
|
||||
function operator<(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a.hs.IsProperSubsetOf(NSToInts(b));
|
||||
function operator<(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a._hs.IsProperSubsetOf(NSToInts(b));
|
||||
function operator<(a: NewSet<byte>; b: NewSet<integer>); extensionmethod := b > a;
|
||||
function operator<(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a.hs.IsProperSubsetOf(NSToInts64(b));
|
||||
function operator<(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a._hs.IsProperSubsetOf(NSToInts64(b));
|
||||
function operator<(a: NewSet<integer>; b: NewSet<int64>); extensionmethod := b > a;
|
||||
|
||||
function operator>(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a.hs.IsProperSupersetOf(NSToInts(b));
|
||||
function operator>(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a._hs.IsProperSupersetOf(NSToInts(b));
|
||||
function operator>(a: NewSet<byte>; b: NewSet<integer>); extensionmethod := b < a;
|
||||
function operator>(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a.hs.IsProperSupersetOf(NSToInts64(b));
|
||||
function operator>(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a._hs.IsProperSupersetOf(NSToInts64(b));
|
||||
function operator>(a: NewSet<integer>; b: NewSet<int64>); extensionmethod := b < a;
|
||||
|
||||
function operator<=(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a.hs.IsSubsetOf(NSToInts(b));
|
||||
function operator<=(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a._hs.IsSubsetOf(NSToInts(b));
|
||||
function operator<=(a: NewSet<byte>; b: NewSet<integer>); extensionmethod := b >= a;
|
||||
function operator<=(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a.hs.IsSubsetOf(NSToInts64(b));
|
||||
function operator<=(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a._hs.IsSubsetOf(NSToInts64(b));
|
||||
function operator<=(a: NewSet<integer>; b: NewSet<int64>); extensionmethod := b >= a;
|
||||
|
||||
function operator>=(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a.hs.IsSupersetOf(NSToInts(b));
|
||||
function operator>=(a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a._hs.IsSupersetOf(NSToInts(b));
|
||||
function operator>=(a: NewSet<byte>; b: NewSet<integer>); extensionmethod := b <= a;
|
||||
function operator>=(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a.hs.IsSupersetOf(NSToInts64(b));
|
||||
function operator>=(a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a._hs.IsSupersetOf(NSToInts64(b));
|
||||
function operator>=(a: NewSet<integer>; b: NewSet<int64>); extensionmethod := b <= a;
|
||||
|
||||
procedure operator*=(var a: NewSet<byte>; b: NewSet<integer>); extensionmethod := a.hs.IntersectWith(NSToBytes(b));
|
||||
procedure operator*=(var a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a.hs.IntersectWith(NSToInts(b));
|
||||
procedure operator*=(var a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a.hs.IntersectWith(NSToInts64(b));
|
||||
procedure operator*=(var a: NewSet<byte>; b: NewSet<integer>); extensionmethod := a._hs.IntersectWith(NSToBytes(b));
|
||||
procedure operator*=(var a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a._hs.IntersectWith(NSToInts(b));
|
||||
procedure operator*=(var a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a._hs.IntersectWith(NSToInts64(b));
|
||||
//procedure operator*=(var a: NewSet<integer>; b: NewSet<int64>); extensionmethod := a._hs.IntersectWith(NSToInts(b));
|
||||
|
||||
//procedure operator*=(var a: NewSet<byte>; b: NewSet<int64>); extensionmethod := a._hs.IntersectWith(NSToBytes(b));
|
||||
//procedure operator*=(var a: NewSet<int64>; b: NewSet<byte>); extensionmethod := a._hs.IntersectWith(NSToInts64(b));
|
||||
procedure operator+=(var a: NewSet<byte>; b: NewSet<integer>); extensionmethod := a.hs.UnionWith(NSToBytes(b));
|
||||
procedure operator+=(var a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a.hs.UnionWith(NSToInts(b));
|
||||
procedure operator+=(var a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a.hs.UnionWith(NSToInts64(b));
|
||||
procedure operator+=(var a: NewSet<byte>; b: NewSet<integer>); extensionmethod := a._hs.UnionWith(NSToBytes(b));
|
||||
procedure operator+=(var a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a._hs.UnionWith(NSToInts(b));
|
||||
procedure operator+=(var a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a._hs.UnionWith(NSToInts64(b));
|
||||
//procedure operator+=(var a: NewSet<integer>; b: NewSet<int64>); extensionmethod := a._hs.UnionWith(NSToInts(b));
|
||||
procedure operator+=(var a: NewSet<byte>; b: NewSet<int64>); extensionmethod := a.hs.UnionWith(NSToBytes(b));
|
||||
procedure operator+=(var a: NewSet<int64>; b: NewSet<byte>); extensionmethod := a.hs.UnionWith(NSToInts64(b));
|
||||
procedure operator+=(var a: NewSet<byte>; b: NewSet<int64>); extensionmethod := a._hs.UnionWith(NSToBytes(b));
|
||||
procedure operator+=(var a: NewSet<int64>; b: NewSet<byte>); extensionmethod := a._hs.UnionWith(NSToInts64(b));
|
||||
|
||||
procedure operator-=(var a: NewSet<byte>; b: NewSet<integer>); extensionmethod := a.hs.ExceptWith(NSToBytes(b));
|
||||
procedure operator-=(var a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a.hs.ExceptWith(NSToInts(b));
|
||||
procedure operator-=(var a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a.hs.ExceptWith(NSToInts64(b));
|
||||
procedure operator-=(var a: NewSet<byte>; b: NewSet<integer>); extensionmethod := a._hs.ExceptWith(NSToBytes(b));
|
||||
procedure operator-=(var a: NewSet<integer>; b: NewSet<byte>); extensionmethod := a._hs.ExceptWith(NSToInts(b));
|
||||
procedure operator-=(var a: NewSet<int64>; b: NewSet<integer>); extensionmethod := a._hs.ExceptWith(NSToInts64(b));
|
||||
//procedure operator-=(var a: NewSet<integer>; b: NewSet<int64>); extensionmethod := a._hs.ExceptWith(NSToInts(b));
|
||||
|
||||
|
||||
|
|
@ -686,7 +686,7 @@ begin
|
|||
end;
|
||||
|
||||
// и для массивов столько же
|
||||
function operator=(a: NewSet<integer>; b: array of byte); extensionmethod := a.hs.SetEquals(b.Select(x -> integer(x)));
|
||||
function operator=(a: NewSet<integer>; b: array of byte); extensionmethod := a._hs.SetEquals(b.Select(x -> integer(x)));
|
||||
function operator=(a: array of byte; b: NewSet<integer>): boolean; extensionmethod := b = a;
|
||||
function operator=(a: array of int64; b: NewSet<integer>); extensionmethod := a.ToHashSet.SetEquals(NSToInts64(b));
|
||||
function operator=(a: NewSet<integer>; b: array of int64): boolean; extensionmethod := b = a;
|
||||
|
|
|
|||
|
|
@ -490,14 +490,14 @@ type
|
|||
private
|
||||
public
|
||||
///--
|
||||
hs := new HashSet<T>;
|
||||
_hs := new HashSet<T>;
|
||||
///--
|
||||
{function hs: HashSet<T>;
|
||||
function hs: HashSet<T>;
|
||||
begin
|
||||
if _hs = nil then
|
||||
_hs := new HashSet<T>;
|
||||
Result := _hs;
|
||||
end;}
|
||||
end;
|
||||
constructor (params a: array of T);
|
||||
begin
|
||||
hs.UnionWith(a);
|
||||
|
|
@ -506,7 +506,7 @@ type
|
|||
function System.Collections.IEnumerable.GetEnumerator: System.Collections.IEnumerator := GetEnumerator;
|
||||
static function operator implicit(a: array of T): NewSet<T>;
|
||||
begin
|
||||
Result.hs := new HashSet<T>(a);
|
||||
Result._hs := new HashSet<T>(a);
|
||||
end;
|
||||
function ToString: string; override;
|
||||
function Count: integer := hs.Count;
|
||||
|
|
@ -550,9 +550,9 @@ type
|
|||
end;
|
||||
|
||||
static function operator implicit(ns: NewSetEmpty): NewSet<T>; begin end;
|
||||
static function operator:=(var Self: NewSet<T>; st: NewSet<T>): NewSet<T>;
|
||||
static function operator:=(var s: NewSet<T>; st: NewSet<T>): NewSet<T>;
|
||||
begin
|
||||
Self.hs := new HashSet<T>(st.hs);
|
||||
s._hs := new HashSet<T>(st.hs);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -577,11 +577,11 @@ type
|
|||
static function operator*(first, second: NewSetEmpty): NewSetEmpty := new NewSetEmpty;
|
||||
static function operator+<T>(first: NewSetEmpty; second: array of T): NewSet<T>;
|
||||
begin
|
||||
Result.hs.UnionWith(second);
|
||||
Result._hs.UnionWith(second);
|
||||
end;
|
||||
static function operator+<T>(first: array of T; second: NewSetEmpty): NewSet<T>;
|
||||
begin
|
||||
Result.hs.UnionWith(first);
|
||||
Result._hs.UnionWith(first);
|
||||
end;
|
||||
static function operator+<T>(first: NewSet<T>; second: NewSetEmpty): NewSet<T> := first;
|
||||
static function operator+<T>(first: NewSetEmpty; second: NewSet<T>): NewSet<T> := second;
|
||||
|
|
@ -595,7 +595,7 @@ type
|
|||
static function operator-<T>(first: NewSetEmpty; second: array of T): NewSet<T>; begin end;
|
||||
static function operator-<T>(first: array of T; second: NewSetEmpty): NewSet<T>;
|
||||
begin
|
||||
Result.hs.UnionWith(first);
|
||||
Result._hs.UnionWith(first);
|
||||
end;
|
||||
function ToString: string; override := '{}';
|
||||
function ToSet<T>(): NewSet<T>; begin end;
|
||||
|
|
@ -15413,14 +15413,14 @@ function EmptySet := _emptyset;
|
|||
[SetCreatorFunction]
|
||||
function __NewSetCreatorInternal<T>(params a: array of T): NewSet<T>;
|
||||
begin
|
||||
Result.hs := new HashSet<T>;
|
||||
Result.hs.UnionWith(a);
|
||||
Result._hs := new HashSet<T>;
|
||||
Result._hs.UnionWith(a);
|
||||
end;
|
||||
|
||||
[SetCreatorFunction]
|
||||
function __NSetInteger(a: array of integer; dd: array of integer): NewSet<integer>;
|
||||
begin
|
||||
Result.hs.UnionWith(a);
|
||||
Result._hs.UnionWith(a);
|
||||
var n := dd.Length;
|
||||
for var i:=0 to n-1 step 2 do
|
||||
begin
|
||||
|
|
@ -15432,7 +15432,7 @@ end;
|
|||
[SetCreatorFunction]
|
||||
function __NSetChar(a: array of char; dd: array of char): NewSet<char>;
|
||||
begin
|
||||
Result.hs.UnionWith(a);
|
||||
Result._hs.UnionWith(a);
|
||||
var n := dd.Length;
|
||||
for var i:=0 to n-1 step 2 do
|
||||
begin
|
||||
|
|
@ -15444,7 +15444,7 @@ end;
|
|||
[SetCreatorFunction]
|
||||
function __NSetBoolean(a: array of boolean; dd: array of boolean): NewSet<boolean>;
|
||||
begin
|
||||
Result.hs.UnionWith(a);
|
||||
Result._hs.UnionWith(a);
|
||||
var n := dd.Length;
|
||||
for var i:=0 to n-1 step 2 do
|
||||
begin
|
||||
|
|
@ -15456,7 +15456,7 @@ end;
|
|||
[SetCreatorFunction]
|
||||
function __NSetEnum<T>(a: array of T; dd: array of T): NewSet<T>;
|
||||
begin
|
||||
Result.hs.UnionWith(a);
|
||||
Result._hs.UnionWith(a);
|
||||
var vals := System.Enum.GetValues(typeof(T)).Cast&<T>.ToArray;
|
||||
var n := dd.Length;
|
||||
for var i:=0 to n-1 step 2 do
|
||||
|
|
@ -15478,49 +15478,49 @@ end;
|
|||
function operator implicit(n: array of integer): set of byte; extensionmethod;
|
||||
begin
|
||||
foreach var x in n do
|
||||
Result.hs.Add(x);
|
||||
Result._hs.Add(x);
|
||||
end;
|
||||
|
||||
function operator implicit(n: array of integer): set of shortint; extensionmethod;
|
||||
begin
|
||||
foreach var x in n do
|
||||
Result.hs.Add(x);
|
||||
Result._hs.Add(x);
|
||||
end;
|
||||
|
||||
function operator implicit(n: array of integer): set of smallint; extensionmethod;
|
||||
begin
|
||||
foreach var x in n do
|
||||
Result.hs.Add(x);
|
||||
Result._hs.Add(x);
|
||||
end;
|
||||
|
||||
function operator implicit(n: array of integer): set of word; extensionmethod;
|
||||
begin
|
||||
foreach var x in n do
|
||||
Result.hs.Add(x);
|
||||
Result._hs.Add(x);
|
||||
end;
|
||||
|
||||
function operator implicit(n: array of integer): set of longword; extensionmethod;
|
||||
begin
|
||||
foreach var x in n do
|
||||
Result.hs.Add(x);
|
||||
Result._hs.Add(x);
|
||||
end;
|
||||
|
||||
function operator implicit(a: array of integer): set of int64; extensionmethod;
|
||||
begin
|
||||
foreach var x in a do
|
||||
Result.hs.Add(x);
|
||||
Result._hs.Add(x);
|
||||
end;
|
||||
|
||||
function operator implicit(a: array of integer): set of uint64; extensionmethod;
|
||||
begin
|
||||
foreach var x in a do
|
||||
Result.hs.Add(x);
|
||||
Result._hs.Add(x);
|
||||
end;
|
||||
|
||||
function operator implicit(a: array of integer): set of BigInteger; extensionmethod;
|
||||
begin
|
||||
foreach var x in a do
|
||||
Result.hs.Add(x);
|
||||
Result._hs.Add(x);
|
||||
end;
|
||||
|
||||
//function operator implicit<T>(ns: NewSetEmpty): NewSet<T>; extensionmethod; begin end;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ begin
|
|||
assert(set1.set1 = []);
|
||||
assert(set1.set2 = []);
|
||||
set2 := set1;
|
||||
Include(set1.set1,'b');
|
||||
Include(set1.set2,'b');
|
||||
Include(set2.set1,'b');
|
||||
Include(set2.set2,'b');
|
||||
assert(set1.set1 = ['b']); // увы - при присваивании не вызывается operator := для компонент
|
||||
|
|
|
|||
|
|
@ -15617,14 +15617,27 @@ namespace PascalABCCompiler.TreeConverter
|
|||
else if (expr is common_static_method_call)
|
||||
{
|
||||
var csmc = expr as common_static_method_call;
|
||||
var properties = new List<common_property_node>();
|
||||
if (csmc.function_node.cont_type != null)
|
||||
{
|
||||
foreach (common_property_node cpn in csmc.function_node.cont_type.properties)
|
||||
if (cpn.get_function == csmc.function_node && cpn.set_function == null)
|
||||
{
|
||||
constant = new common_static_method_call_as_constant(csmc, null);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var values = (csmc.parameters[0] as array_initializer).element_values;
|
||||
// Надо компоненты проверять на константность
|
||||
foreach (expression_node en in values)
|
||||
{
|
||||
if (!(en is constant_node))
|
||||
AddError(loc, "CONSTANT_EXPRESSION_EXPECTED");
|
||||
}
|
||||
constant = new common_static_method_call_as_constant(csmc, loc);
|
||||
return constant;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue