From 78ea0be0e17361d3c14e57711edeb10b482648d8 Mon Sep 17 00:00:00 2001 From: miks1965 Date: Thu, 31 May 2018 00:40:29 +0300 Subject: [PATCH] bug fix #875 bug fix #876 --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- Localization/DefaultLang.resources | Bin 82950 -> 82950 bytes .../PascalABCParserNewSaushkin/ABCPascal.cs | 2 +- .../PascalABCParserNewSaushkin/ABCPascal.y | 2 +- .../ABCPascalYacc.cs | 4 +- Parsers/PascalABCParserNewSaushkin/PABC.ymc | 1 + ReleaseGenerators/PascalABCNET_version.nsh | 2 +- TestSuite/CompilationSamples/PABCSystem.pas | 134 ++++++++++++++++-- TestSuite/CompilationSamples/graph3d.pas | 5 +- TestSuite/OperatorEqNEqTest.pas | 23 +++ bin/Lib/Graph3D.pas | 5 +- bin/Lib/PABCSystem.pas | 134 ++++++++++++++++-- bin/Lng/Eng/PascalABCParser.dat | 1 + bin/Lng/Eng/SemanticErrors_ms.dat | 1 - bin/Lng/Rus/PascalABCParser.dat | 1 + bin/Lng/Rus/SemanticErrors_ms.dat | 1 - 17 files changed, 284 insertions(+), 38 deletions(-) create mode 100644 TestSuite/OperatorEqNEqTest.pas diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index fed4eac3d..b408aa61f 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "4"; public const string Build = "0"; - public const string Revision = "1670"; + public const string Revision = "1671"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 5d5fbefb4..37e758731 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=4 -%REVISION%=1670 %COREVERSION%=0 +%REVISION%=1671 +%MINOR%=4 %MAJOR%=3 diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index c1a9fc895617b3cb0c8f7a51eba9ddff7a6c5f72..afd94794c91f118365212b0af5d8da2fbe1723d6 100644 GIT binary patch delta 23 fcmZqcU~TJQ-4O0D`A>hs=5U9l{+nYatlA6!e7*}N delta 23 fcmZqcU~TJQ-4O1udAq|>|H // GPLEX frame file diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y index fb955ae39..1b0283eda 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.y +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.y @@ -3286,7 +3286,7 @@ tuple if ($6 != null) parsertools.AddErrorFromResource("BAD_TUPLE",@6);*/ - if (($4 as expression_list).Count>7) + if (($4 as expression_list).Count>6) parsertools.AddErrorFromResource("TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7",@$); ($4 as expression_list).Insert(0,$2); $$ = new tuple_node($4 as expression_list,@$); diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 09a58c9d0..cd3b83d1d 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -2,7 +2,7 @@ // GPPG version 1.3.6 // Machine: DESKTOP-A6LT9RI -// DateTime: 22.05.2018 22:30:38 +// DateTime: 31.05.2018 0:33:46 // UserName: ????????? // Input file @@ -5453,7 +5453,7 @@ public partial class GPPGParser: ShiftReduceParser7) + if ((ValueStack[ValueStack.Depth-4].stn as expression_list).Count>6) parsertools.AddErrorFromResource("TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7",CurrentLocationSpan); (ValueStack[ValueStack.Depth-4].stn as expression_list).Insert(0,ValueStack[ValueStack.Depth-6].ex); CurrentSemanticValue.ex = new tuple_node(ValueStack[ValueStack.Depth-4].stn as expression_list,CurrentLocationSpan); diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index da13e037c..868a60ccc 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -190,5 +190,6 @@ script= + diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index e4e70ae96..27aae61a0 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.4.0.1670' +!define VERSION '3.4.0.1671' diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index 0d0c5fcdb..20ecef6f7 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -3476,7 +3476,7 @@ begin Result := Self; end; -function operator=(x,y: HashSet): boolean; extensionmethod; +function InternalEqual(x,y: HashSet): boolean; begin var xn := Object.ReferenceEquals(x,nil); var yn := Object.ReferenceEquals(y,nil); @@ -3487,7 +3487,9 @@ begin else Result := x.SetEquals(y); end; -function operator<>(x,y: HashSet); extensionmethod := not (x=y); +function operator=(x,y: HashSet): boolean; extensionmethod := InternalEqual(x,y); + +function operator<>(x,y: HashSet); extensionmethod := not InternalEqual(x,y); function operator-(x, y: HashSet): HashSet; extensionmethod; begin @@ -3561,7 +3563,7 @@ begin Result := Self; end; -function operator=(x,y: SortedSet): boolean; extensionmethod; +function InternalEqual(x,y: SortedSet): boolean; begin var xn := Object.ReferenceEquals(x,nil); var yn := Object.ReferenceEquals(y,nil); @@ -3572,7 +3574,9 @@ begin else Result := x.SetEquals(y); end; -function operator<>(x, y: SortedSet); extensionmethod := not x.SetEquals(y); +function operator=(x,y: SortedSet): boolean; extensionmethod := InternalEqual(x,y); + +function operator<>(x, y: SortedSet); extensionmethod := not InternalEqual(x,y); function operator-(x, y: SortedSet): SortedSet; extensionmethod; begin @@ -10340,9 +10344,21 @@ begin end; ///-- -function operator= (Self: (T1,T2); v: (T1,T2)); extensionmethod := Object.ReferenceEquals(Self,nil) ? Object.ReferenceEquals(v,nil): Self.Equals(v); +function InternalEqual (x: (T1,T2); y: (T1,T2)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; + ///-- -function operator<> (Self: (T1,T2); v: (T1,T2)); extensionmethod := not (Self = v); +function operator= (x: (T1,T2); y: (T1,T2)): boolean; extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2); y: (T1,T2)): boolean; extensionmethod := not InternalEqual(x,y); ///-- function CompareToTup2(v1: (T1, T2); v2: (T1, T2)) := (v1 as System.IComparable).CompareTo(v2); ///-- @@ -10355,9 +10371,20 @@ function operator>(Self: (T1, T2); v: (T1, T2)); extensionmethod := Comp function operator>=(Self: (T1, T2); v: (T1, T2)); extensionmethod := CompareToTup2(Self, v) >= 0; ///-- -function operator= (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := Object.ReferenceEquals(Self,nil) ? Object.ReferenceEquals(v,nil): Self.Equals(v); +function InternalEqual (x: (T1,T2,T3); y: (T1,T2,T3)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; ///-- -function operator<> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := not (Self = v); +function operator= (x: (T1,T2,T3); y: (T1,T2,T3)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3); y: (T1,T2,T3)); extensionmethod := not InternalEqual(x,y); ///-- function CompareToTup3(v1: (T1, T2, T3); v2: (T1, T2, T3)) := (v1 as System.IComparable).CompareTo(v2); ///-- @@ -10370,9 +10397,20 @@ function operator>(Self: (T1, T2, T3); v: (T1, T2, T3)); extensionmeth function operator>=(Self: (T1, T2, T3); v: (T1, T2, T3)); extensionmethod := CompareToTup3(Self, v) >= 0; ///-- -function operator= (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := Object.ReferenceEquals(Self,nil) ? Object.ReferenceEquals(v,nil): Self.Equals(v); +function InternalEqual (x: (T1,T2,T3,T4); y: (T1,T2,T3,T4)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; ///-- -function operator<> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := not (Self = v); +function operator= (x: (T1,T2,T3,T4); y: (T1,T2,T3,T4)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3,T4); y: (T1,T2,T3,T4)); extensionmethod := not InternalEqual(x,y); ///-- function CompareToTup4(v1: (T1, T2, T3, T4); v2: (T1, T2, T3, T4)) := (v1 as System.IComparable).CompareTo(v2); ///-- @@ -10384,7 +10422,83 @@ function operator>(Self: (T1, T2, T3, T4); v: (T1, T2, T3, T4)); ex ///-- function operator>=(Self: (T1, T2, T3, T4); v: (T1, T2, T3, T4)); extensionmethod := CompareToTup4(Self, v) >= 0; +///-- +function InternalEqual (x: (T1,T2,T3,T4,T5); y: (T1,T2,T3,T4,T5)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; +///-- +function operator= (x: (T1,T2,T3,T4,T5); y: (T1,T2,T3,T4,T5)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3,T4,T5); y: (T1,T2,T3,T4,T5)); extensionmethod := not InternalEqual(x,y); +///-- +function CompareToTup5(v1: (T1, T2, T3, T4,T5); v2: (T1, T2, T3, T4,T5)) := (v1 as System.IComparable).CompareTo(v2); +///-- +function operator<(Self: (T1, T2, T3, T4,T5); v: (T1, T2, T3, T4,T5)); extensionmethod := CompareToTup5(Self, v) < 0; +///-- +function operator<=(Self: (T1, T2, T3, T4,T5); v: (T1, T2, T3, T4,T5)); extensionmethod := CompareToTup5(Self, v) <= 0; +///-- +function operator>(Self: (T1, T2, T3, T4,T5); v: (T1, T2, T3, T4,T5)); extensionmethod := CompareToTup5(Self, v) > 0; +///-- +function operator>=(Self: (T1, T2, T3, T4,T5); v: (T1, T2, T3, T4,T5)); extensionmethod := CompareToTup5(Self, v) >= 0; +///-- +function InternalEqual (x: (T1,T2,T3,T4,T5,T6); y: (T1,T2,T3,T4,T5,T6)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; +///-- +function operator= (x: (T1,T2,T3,T4,T5,T6); y: (T1,T2,T3,T4,T5,T6)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3,T4,T5,T6); y: (T1,T2,T3,T4,T5,T6)); extensionmethod := not InternalEqual(x,y); +///-- +function CompareToTup5(v1: (T1, T2, T3, T4,T5,T6); v2: (T1, T2, T3, T4,T5,T6)) := (v1 as System.IComparable).CompareTo(v2); +///-- +function operator<(Self: (T1, T2, T3, T4,T5,T6); v: (T1, T2, T3, T4,T5,T6)); extensionmethod := CompareToTup5(Self, v) < 0; +///-- +function operator<=(Self: (T1, T2, T3, T4,T5,T6); v: (T1, T2, T3, T4,T5,T6)); extensionmethod := CompareToTup5(Self, v) <= 0; +///-- +function operator>(Self: (T1, T2, T3, T4,T5,T6); v: (T1, T2, T3, T4,T5,T6)); extensionmethod := CompareToTup5(Self, v) > 0; +///-- +function operator>=(Self: (T1, T2, T3, T4,T5,T6); v: (T1, T2, T3, T4,T5,T6)); extensionmethod := CompareToTup5(Self, v) >= 0; + +///-- +function InternalEqual (x: (T1,T2,T3,T4,T5,T6,T7); y: (T1,T2,T3,T4,T5,T6,T7)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; +///-- +function operator= (x: (T1,T2,T3,T4,T5,T6,T7); y: (T1,T2,T3,T4,T5,T6,T7)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3,T4,T5,T6,T7); y: (T1,T2,T3,T4,T5,T6,T7)); extensionmethod := not InternalEqual(x,y); +///-- +function CompareToTup5(v1: (T1, T2, T3, T4,T5,T6,T7); v2: (T1, T2, T3, T4,T5,T6,T7)) := (v1 as System.IComparable).CompareTo(v2); +///-- +function operator<(Self: (T1, T2, T3, T4,T5,T6,T7); v: (T1, T2, T3, T4,T5,T6,T7)); extensionmethod := CompareToTup5(Self, v) < 0; +///-- +function operator<=(Self: (T1, T2, T3, T4,T5,T6,T7); v: (T1, T2, T3, T4,T5,T6,T7)); extensionmethod := CompareToTup5(Self, v) <= 0; +///-- +function operator>(Self: (T1, T2, T3, T4,T5,T6,T7); v: (T1, T2, T3, T4,T5,T6,T7)); extensionmethod := CompareToTup5(Self, v) > 0; +///-- +function operator>=(Self: (T1, T2, T3, T4,T5,T6,T7); v: (T1, T2, T3, T4,T5,T6,T7)); extensionmethod := CompareToTup5(Self, v) >= 0; // -------------------------------------------- // Методы расширения типа Tuple # Extension methods for Tuple // ------------------------------------------- diff --git a/TestSuite/CompilationSamples/graph3d.pas b/TestSuite/CompilationSamples/graph3d.pas index ffb3f5afb..9f321bdf6 100644 --- a/TestSuite/CompilationSamples/graph3d.pas +++ b/TestSuite/CompilationSamples/graph3d.pas @@ -386,10 +386,7 @@ type end; public - constructor(model: Visual3D); - begin - CreateBase0(model, 0, 0, 0); - end; + constructor(model: Visual3D) := CreateBase0(model, 0, 0, 0); property X: real read GetX write SetX; property Y: real read GetY write SetY; diff --git a/TestSuite/OperatorEqNEqTest.pas b/TestSuite/OperatorEqNEqTest.pas new file mode 100644 index 000000000..639168725 --- /dev/null +++ b/TestSuite/OperatorEqNEqTest.pas @@ -0,0 +1,23 @@ +begin + var a := (1,2,3,4,5,6,7); + var b := (1,2,3,4,5,6,7); + Assert(b=a); + Assert(not (b<>a)); + + var s1 := SSet(1,2,3); + var s2 := SSet(1,2,3); + Assert(s1=s2); + Assert(not (s1<>s2)); + + var h1 := HSet(1,2,3); + var h2 := HSet(1,2,3); + Assert(h1=h2); + Assert(not (h1<>h2)); + + var b1: BigInteger := 2; + var b2: Integer := 2; + Assert(b1=b2); + Assert(not (b1<>b2)); + Assert(b2=b1); + Assert(not (b2<>b1)); +end. \ No newline at end of file diff --git a/bin/Lib/Graph3D.pas b/bin/Lib/Graph3D.pas index ffb3f5afb..9f321bdf6 100644 --- a/bin/Lib/Graph3D.pas +++ b/bin/Lib/Graph3D.pas @@ -386,10 +386,7 @@ type end; public - constructor(model: Visual3D); - begin - CreateBase0(model, 0, 0, 0); - end; + constructor(model: Visual3D) := CreateBase0(model, 0, 0, 0); property X: real read GetX write SetX; property Y: real read GetY write SetY; diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index 0d0c5fcdb..20ecef6f7 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -3476,7 +3476,7 @@ begin Result := Self; end; -function operator=(x,y: HashSet): boolean; extensionmethod; +function InternalEqual(x,y: HashSet): boolean; begin var xn := Object.ReferenceEquals(x,nil); var yn := Object.ReferenceEquals(y,nil); @@ -3487,7 +3487,9 @@ begin else Result := x.SetEquals(y); end; -function operator<>(x,y: HashSet); extensionmethod := not (x=y); +function operator=(x,y: HashSet): boolean; extensionmethod := InternalEqual(x,y); + +function operator<>(x,y: HashSet); extensionmethod := not InternalEqual(x,y); function operator-(x, y: HashSet): HashSet; extensionmethod; begin @@ -3561,7 +3563,7 @@ begin Result := Self; end; -function operator=(x,y: SortedSet): boolean; extensionmethod; +function InternalEqual(x,y: SortedSet): boolean; begin var xn := Object.ReferenceEquals(x,nil); var yn := Object.ReferenceEquals(y,nil); @@ -3572,7 +3574,9 @@ begin else Result := x.SetEquals(y); end; -function operator<>(x, y: SortedSet); extensionmethod := not x.SetEquals(y); +function operator=(x,y: SortedSet): boolean; extensionmethod := InternalEqual(x,y); + +function operator<>(x, y: SortedSet); extensionmethod := not InternalEqual(x,y); function operator-(x, y: SortedSet): SortedSet; extensionmethod; begin @@ -10340,9 +10344,21 @@ begin end; ///-- -function operator= (Self: (T1,T2); v: (T1,T2)); extensionmethod := Object.ReferenceEquals(Self,nil) ? Object.ReferenceEquals(v,nil): Self.Equals(v); +function InternalEqual (x: (T1,T2); y: (T1,T2)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; + ///-- -function operator<> (Self: (T1,T2); v: (T1,T2)); extensionmethod := not (Self = v); +function operator= (x: (T1,T2); y: (T1,T2)): boolean; extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2); y: (T1,T2)): boolean; extensionmethod := not InternalEqual(x,y); ///-- function CompareToTup2(v1: (T1, T2); v2: (T1, T2)) := (v1 as System.IComparable).CompareTo(v2); ///-- @@ -10355,9 +10371,20 @@ function operator>(Self: (T1, T2); v: (T1, T2)); extensionmethod := Comp function operator>=(Self: (T1, T2); v: (T1, T2)); extensionmethod := CompareToTup2(Self, v) >= 0; ///-- -function operator= (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := Object.ReferenceEquals(Self,nil) ? Object.ReferenceEquals(v,nil): Self.Equals(v); +function InternalEqual (x: (T1,T2,T3); y: (T1,T2,T3)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; ///-- -function operator<> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := not (Self = v); +function operator= (x: (T1,T2,T3); y: (T1,T2,T3)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3); y: (T1,T2,T3)); extensionmethod := not InternalEqual(x,y); ///-- function CompareToTup3(v1: (T1, T2, T3); v2: (T1, T2, T3)) := (v1 as System.IComparable).CompareTo(v2); ///-- @@ -10370,9 +10397,20 @@ function operator>(Self: (T1, T2, T3); v: (T1, T2, T3)); extensionmeth function operator>=(Self: (T1, T2, T3); v: (T1, T2, T3)); extensionmethod := CompareToTup3(Self, v) >= 0; ///-- -function operator= (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := Object.ReferenceEquals(Self,nil) ? Object.ReferenceEquals(v,nil): Self.Equals(v); +function InternalEqual (x: (T1,T2,T3,T4); y: (T1,T2,T3,T4)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; ///-- -function operator<> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := not (Self = v); +function operator= (x: (T1,T2,T3,T4); y: (T1,T2,T3,T4)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3,T4); y: (T1,T2,T3,T4)); extensionmethod := not InternalEqual(x,y); ///-- function CompareToTup4(v1: (T1, T2, T3, T4); v2: (T1, T2, T3, T4)) := (v1 as System.IComparable).CompareTo(v2); ///-- @@ -10384,7 +10422,83 @@ function operator>(Self: (T1, T2, T3, T4); v: (T1, T2, T3, T4)); ex ///-- function operator>=(Self: (T1, T2, T3, T4); v: (T1, T2, T3, T4)); extensionmethod := CompareToTup4(Self, v) >= 0; +///-- +function InternalEqual (x: (T1,T2,T3,T4,T5); y: (T1,T2,T3,T4,T5)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; +///-- +function operator= (x: (T1,T2,T3,T4,T5); y: (T1,T2,T3,T4,T5)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3,T4,T5); y: (T1,T2,T3,T4,T5)); extensionmethod := not InternalEqual(x,y); +///-- +function CompareToTup5(v1: (T1, T2, T3, T4,T5); v2: (T1, T2, T3, T4,T5)) := (v1 as System.IComparable).CompareTo(v2); +///-- +function operator<(Self: (T1, T2, T3, T4,T5); v: (T1, T2, T3, T4,T5)); extensionmethod := CompareToTup5(Self, v) < 0; +///-- +function operator<=(Self: (T1, T2, T3, T4,T5); v: (T1, T2, T3, T4,T5)); extensionmethod := CompareToTup5(Self, v) <= 0; +///-- +function operator>(Self: (T1, T2, T3, T4,T5); v: (T1, T2, T3, T4,T5)); extensionmethod := CompareToTup5(Self, v) > 0; +///-- +function operator>=(Self: (T1, T2, T3, T4,T5); v: (T1, T2, T3, T4,T5)); extensionmethod := CompareToTup5(Self, v) >= 0; +///-- +function InternalEqual (x: (T1,T2,T3,T4,T5,T6); y: (T1,T2,T3,T4,T5,T6)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; +///-- +function operator= (x: (T1,T2,T3,T4,T5,T6); y: (T1,T2,T3,T4,T5,T6)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3,T4,T5,T6); y: (T1,T2,T3,T4,T5,T6)); extensionmethod := not InternalEqual(x,y); +///-- +function CompareToTup5(v1: (T1, T2, T3, T4,T5,T6); v2: (T1, T2, T3, T4,T5,T6)) := (v1 as System.IComparable).CompareTo(v2); +///-- +function operator<(Self: (T1, T2, T3, T4,T5,T6); v: (T1, T2, T3, T4,T5,T6)); extensionmethod := CompareToTup5(Self, v) < 0; +///-- +function operator<=(Self: (T1, T2, T3, T4,T5,T6); v: (T1, T2, T3, T4,T5,T6)); extensionmethod := CompareToTup5(Self, v) <= 0; +///-- +function operator>(Self: (T1, T2, T3, T4,T5,T6); v: (T1, T2, T3, T4,T5,T6)); extensionmethod := CompareToTup5(Self, v) > 0; +///-- +function operator>=(Self: (T1, T2, T3, T4,T5,T6); v: (T1, T2, T3, T4,T5,T6)); extensionmethod := CompareToTup5(Self, v) >= 0; + +///-- +function InternalEqual (x: (T1,T2,T3,T4,T5,T6,T7); y: (T1,T2,T3,T4,T5,T6,T7)): boolean; +begin + var xn := Object.ReferenceEquals(x,nil); + var yn := Object.ReferenceEquals(y,nil); + if xn then + Result := yn + else if yn then + Result := xn + else Result := x.Equals(y); +end; +///-- +function operator= (x: (T1,T2,T3,T4,T5,T6,T7); y: (T1,T2,T3,T4,T5,T6,T7)); extensionmethod := InternalEqual(x,y); +///-- +function operator<> (x: (T1,T2,T3,T4,T5,T6,T7); y: (T1,T2,T3,T4,T5,T6,T7)); extensionmethod := not InternalEqual(x,y); +///-- +function CompareToTup5(v1: (T1, T2, T3, T4,T5,T6,T7); v2: (T1, T2, T3, T4,T5,T6,T7)) := (v1 as System.IComparable).CompareTo(v2); +///-- +function operator<(Self: (T1, T2, T3, T4,T5,T6,T7); v: (T1, T2, T3, T4,T5,T6,T7)); extensionmethod := CompareToTup5(Self, v) < 0; +///-- +function operator<=(Self: (T1, T2, T3, T4,T5,T6,T7); v: (T1, T2, T3, T4,T5,T6,T7)); extensionmethod := CompareToTup5(Self, v) <= 0; +///-- +function operator>(Self: (T1, T2, T3, T4,T5,T6,T7); v: (T1, T2, T3, T4,T5,T6,T7)); extensionmethod := CompareToTup5(Self, v) > 0; +///-- +function operator>=(Self: (T1, T2, T3, T4,T5,T6,T7); v: (T1, T2, T3, T4,T5,T6,T7)); extensionmethod := CompareToTup5(Self, v) >= 0; // -------------------------------------------- // Методы расширения типа Tuple # Extension methods for Tuple // ------------------------------------------- diff --git a/bin/Lng/Eng/PascalABCParser.dat b/bin/Lng/Eng/PascalABCParser.dat index 55ae4a604..2cac9acc4 100644 --- a/bin/Lng/Eng/PascalABCParser.dat +++ b/bin/Lng/Eng/PascalABCParser.dat @@ -61,3 +61,4 @@ USING_UNLOCAL_FOREACH_VARIABLE=Cycle counter variable should be declared in fore OVERLOAD_IS_NOT_USED=overload is not used in PascalABC.NET ONLY_BASE_ASSIGNMENT_FOR_TUPLE=Tuple allows only base assignment := BAD_FORMAT_STRING=Interpolated string has invalid format +TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7=Count of Tuple elements must be <=7 diff --git a/bin/Lng/Eng/SemanticErrors_ms.dat b/bin/Lng/Eng/SemanticErrors_ms.dat index c21b23f34..c9a4e349a 100644 --- a/bin/Lng/Eng/SemanticErrors_ms.dat +++ b/bin/Lng/Eng/SemanticErrors_ms.dat @@ -10,5 +10,4 @@ ONLY_IN_SHORT_FUNC_DEFS_RETURN_TYPE_CANBE_OMITTED=Only in short function definit ONE_TKIDENTIFIER=Type here must be identifier SUGARED_NODE_{0}_IN_SYNTAX_TREE_VISITOR=Sugared node {0} must not be visited in syntax_tree_visitor MISSED_SEMANTIC_CHECK_FOR_SUGARED_NODE_{0}=Missed semantic check for sugared node {0} -TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7=Count of Tuple elements must be <=7 OPERATOR_DQ_MUST_BE_USED_WITH_A_REFERENCE_TYPE_VALUETYPE=Left operand of ?. operation must have reference type diff --git a/bin/Lng/Rus/PascalABCParser.dat b/bin/Lng/Rus/PascalABCParser.dat index 1273abcca..844a9d773 100644 --- a/bin/Lng/Rus/PascalABCParser.dat +++ b/bin/Lng/Rus/PascalABCParser.dat @@ -60,3 +60,4 @@ USING_UNLOCAL_FOREACH_VARIABLE=Параметр цикла foreach должен OVERLOAD_IS_NOT_USED=overload не используется в PascalABC.NET ONLY_BASE_ASSIGNMENT_FOR_TUPLE=Для кортежа допустимо только обычное присваивание := BAD_FORMAT_STRING=Встречена неправильная форматная строка +TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7=Количество элементов кортежа не должно быть больше 7 diff --git a/bin/Lng/Rus/SemanticErrors_ms.dat b/bin/Lng/Rus/SemanticErrors_ms.dat index 68abbbf14..3d2710060 100644 --- a/bin/Lng/Rus/SemanticErrors_ms.dat +++ b/bin/Lng/Rus/SemanticErrors_ms.dat @@ -10,5 +10,4 @@ ONLY_IN_SHORT_FUNC_DEFS_RETURN_TYPE_CANBE_OMITTED=Только в коротки ONE_TKIDENTIFIER=В качестве типа ожидался идентификатор SUGARED_NODE_{0}_IN_SYNTAX_TREE_VISITOR=Сахарный узел {0} не должен обходиться в syntax_tree_visitor. Обратитесь к разработчикам PascalABC.NET MISSED_SEMANTIC_CHECK_FOR_SUGARED_NODE_{0}=Отсутствует семантическая проверка для сахарного узла {0} -TUPLE_ELEMENTS_COUNT_MUST_BE_LESSEQUAL_7=Количество элементов кортежа не должно быть больше 7 OPERATOR_DQ_MUST_BE_USED_WITH_A_REFERENCE_TYPE_VALUETYPE=Левый операнд операции ?. должен иметь ссылочный тип \ No newline at end of file