Несколько важных правок в syntax_tree_visitor.cs, связанных с обходом statement_list
Теперь оператор внутриблочного описания возвращает нулевой semantic_node (всё добавлено в семантическое дерево ранее). В семантические дерево узлы, возвращающие нулевой semantic_node, не добавляются Добавлены также операторы сравнения < > для Tuples
This commit is contained in:
parent
d4f9cead8d
commit
9ccc781465
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
||||||
public const string Major = "3";
|
public const string Major = "3";
|
||||||
public const string Minor = "2";
|
public const string Minor = "2";
|
||||||
public const string Build = "0";
|
public const string Build = "0";
|
||||||
public const string Revision = "1374";
|
public const string Revision = "1376";
|
||||||
|
|
||||||
public const string MainVersion = Major + "." + Minor;
|
public const string MainVersion = Major + "." + Minor;
|
||||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%MINOR%=2
|
%MINOR%=2
|
||||||
%REVISION%=1374
|
%REVISION%=1376
|
||||||
%COREVERSION%=0
|
%COREVERSION%=0
|
||||||
%MAJOR%=3
|
%MAJOR%=3
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.2.0.1374'
|
!define VERSION '3.2.0.1376'
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using PascalABCCompiler.SyntaxTree;
|
using PascalABCCompiler.SyntaxTree;
|
||||||
using SyntaxVisitors;
|
using SyntaxVisitors;
|
||||||
|
using SyntaxVisitors.SugarVisitors;
|
||||||
|
|
||||||
namespace PascalABCCompiler.SyntaxTreeConverters
|
namespace PascalABCCompiler.SyntaxTreeConverters
|
||||||
{
|
{
|
||||||
|
|
@ -19,6 +20,9 @@ namespace PascalABCCompiler.SyntaxTreeConverters
|
||||||
// Выносим выражения с лямбдами из заголовка foreach
|
// Выносим выражения с лямбдами из заголовка foreach
|
||||||
StandOutExprWithLambdaInForeachSequenceVisitor.New.ProcessNode(root);
|
StandOutExprWithLambdaInForeachSequenceVisitor.New.ProcessNode(root);
|
||||||
|
|
||||||
|
// Пока не доделали
|
||||||
|
//SliceQuestionDesugarVisitor.New.ProcessNode(root);
|
||||||
|
|
||||||
// Всё, связанное с yield
|
// Всё, связанное с yield
|
||||||
root.visit(new MarkMethodHasYieldAndCheckSomeErrorsVisitor());
|
root.visit(new MarkMethodHasYieldAndCheckSomeErrorsVisitor());
|
||||||
ProcessYieldCapturedVarsVisitor.New.ProcessNode(root);
|
ProcessYieldCapturedVarsVisitor.New.ProcessNode(root);
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
<Compile Include="BaseVisitors\HasStatementVisitor.cs" />
|
<Compile Include="BaseVisitors\HasStatementVisitor.cs" />
|
||||||
<Compile Include="BaseVisitors\SmallHelperVisitors.cs" />
|
<Compile Include="BaseVisitors\SmallHelperVisitors.cs" />
|
||||||
<Compile Include="ChangeWhileVisitor.cs" />
|
<Compile Include="ChangeWhileVisitor.cs" />
|
||||||
|
<Compile Include="SugarVisitors\SliceQuestionDesugarVisitor.cs" />
|
||||||
<Compile Include="YieldVisitors\ObjectCopier\ObjectCopier.cs" />
|
<Compile Include="YieldVisitors\ObjectCopier\ObjectCopier.cs" />
|
||||||
<Compile Include="Optimization\CalcConstExprs.cs" />
|
<Compile Include="Optimization\CalcConstExprs.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
|
|
||||||
|
|
@ -9808,41 +9808,49 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator=<T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator=<T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := Self.Equals( v ) ;
|
||||||
begin
|
///--
|
||||||
Result := Self.Equals( v ) ;
|
function operator<><T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := not Self.Equals( v );
|
||||||
end;
|
///--
|
||||||
|
function CompareToTup2<T1,T2>(v1: (T1,T2); v2: (T1,T2)) := (v1 as System.IComparable).CompareTo(v2);
|
||||||
|
///--
|
||||||
|
function operator<<T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := CompareToTup2(Self,v) < 0;
|
||||||
|
///--
|
||||||
|
function operator<=<T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := CompareToTup2(Self,v) <= 0;
|
||||||
|
///--
|
||||||
|
function operator><T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := CompareToTup2(Self,v) > 0;
|
||||||
|
///--
|
||||||
|
function operator>=<T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := CompareToTup2(Self,v) >= 0;
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator<><T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator=<T1, T2, T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := Self.Equals( v ) ;
|
||||||
begin
|
///--
|
||||||
Result := not Self.Equals( v ) ;
|
function operator<><T1, T2, T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := not Self.Equals( v );
|
||||||
end;
|
///--
|
||||||
|
function CompareToTup3<T1,T2,T3>(v1: (T1,T2,T3); v2: (T1,T2,T3)) := (v1 as System.IComparable).CompareTo(v2);
|
||||||
|
///--
|
||||||
|
function operator<<T1,T2,T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := CompareToTup3(Self,v) < 0;
|
||||||
|
///--
|
||||||
|
function operator<=<T1,T2,T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := CompareToTup3(Self,v) <= 0;
|
||||||
|
///--
|
||||||
|
function operator><T1,T2,T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := CompareToTup3(Self,v) > 0;
|
||||||
|
///--
|
||||||
|
function operator>=<T1,T2,T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := CompareToTup3(Self,v) >= 0;
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator<<T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator=<T1, T2, T3, T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := Self.Equals( v ) ;
|
||||||
begin
|
|
||||||
Result := (Self as System.IComparable).CompareTo( v ) < 0 ;
|
|
||||||
end;
|
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator<=<T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator<><T1, T2, T3, T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := not Self.Equals( v );
|
||||||
begin
|
|
||||||
Result := (Self as System.IComparable).CompareTo( v ) <= 0 ;
|
|
||||||
end;
|
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator><T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function CompareToTup4<T1,T2,T3,T4>(v1: (T1,T2,T3,T4); v2: (T1,T2,T3,T4)) := (v1 as System.IComparable).CompareTo(v2);
|
||||||
begin
|
|
||||||
Result := (Self as System.IComparable).CompareTo( v ) > 0 ;
|
|
||||||
end;
|
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator>=<T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator<<T1,T2,T3,T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := CompareToTup4(Self,v) < 0;
|
||||||
begin
|
///--
|
||||||
Result := (Self as System.IComparable).CompareTo( v ) >= 0 ;
|
function operator<=<T1,T2,T3,T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := CompareToTup4(Self,v) <= 0;
|
||||||
end;
|
///--
|
||||||
|
function operator><T1,T2,T3,T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := CompareToTup4(Self,v) > 0;
|
||||||
|
///--
|
||||||
|
function operator>=<T1,T2,T3,T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := CompareToTup4(Self,v) >= 0;
|
||||||
|
|
||||||
// --------------------------------------------
|
// --------------------------------------------
|
||||||
// Методы расширения типа Tuple # Extension methods for Tuple
|
// Методы расширения типа Tuple # Extension methods for Tuple
|
||||||
|
|
|
||||||
6
TestSuite/tuple_var1.pas
Normal file
6
TestSuite/tuple_var1.pas
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
begin
|
||||||
|
var pair := (3,5);
|
||||||
|
(var a, var b) := pair;
|
||||||
|
Assert((a=3) and (b=5) );
|
||||||
|
Assert((a,b)=(3,5));
|
||||||
|
end.
|
||||||
|
|
@ -770,8 +770,9 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
//try
|
//try
|
||||||
{
|
{
|
||||||
sn = ret.visit(st);
|
sn = ret.visit(st);
|
||||||
if (sn == null)
|
// SSM 19/01/17 закомментировал две следующие строчки
|
||||||
sn = new empty_statement(null);
|
//if (sn == null)
|
||||||
|
// sn = new empty_statement(null);
|
||||||
}
|
}
|
||||||
/*catch (PascalABCCompiler.Errors.Error e)
|
/*catch (PascalABCCompiler.Errors.Error e)
|
||||||
{
|
{
|
||||||
|
|
@ -16287,10 +16288,12 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
statement syntax_statement = _statement_list.subnodes[i];
|
statement syntax_statement = _statement_list.subnodes[i];
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (syntax_statement is SyntaxTree.var_statement)
|
// SSM выкинул эти три строки - теперь внутриблочные описания обрабатываются как обычные операторы.
|
||||||
visit(syntax_statement as SyntaxTree.var_statement);
|
// При этом в конце visit(var_statement) стоит вызов ret.reset(), который возвращает нулевой semantic_statement - и всё работает эквивалентно
|
||||||
else if (MustVisitBody)
|
//if (syntax_statement is SyntaxTree.var_statement)
|
||||||
{
|
// visit(syntax_statement as SyntaxTree.var_statement); // Добавление в текущий statements_list происходит опосредованно !!
|
||||||
|
//else if (MustVisitBody) // MustVisitBody - всегда True!!!
|
||||||
|
//{
|
||||||
//(ssyy) TODO Сделать по-другому!!!
|
//(ssyy) TODO Сделать по-другому!!!
|
||||||
statement_node semantic_statement = convert_strong(syntax_statement);
|
statement_node semantic_statement = convert_strong(syntax_statement);
|
||||||
//(ssyy) Проверка для C
|
//(ssyy) Проверка для C
|
||||||
|
|
@ -16304,7 +16307,7 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
}
|
}
|
||||||
|
|
||||||
context.allow_inherited_ctor_call = false;
|
context.allow_inherited_ctor_call = false;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
catch (Errors.Error ex)
|
catch (Errors.Error ex)
|
||||||
{
|
{
|
||||||
|
|
@ -17781,6 +17784,7 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
public override void visit(SyntaxTree.var_statement node)
|
public override void visit(SyntaxTree.var_statement node)
|
||||||
{
|
{
|
||||||
visit(node.var_def);
|
visit(node.var_def);
|
||||||
|
ret.reset(); // SSM 19.01.17 не возвращать семантическое значение т.к. ничего не нужно добавлять в текущий список операторов!!
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void visit(SyntaxTree.expression_as_statement node)
|
public override void visit(SyntaxTree.expression_as_statement node)
|
||||||
|
|
@ -19202,7 +19206,8 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
new dot_node(new ident(tname),new ident("Item" + (i + 1).ToString())),
|
new dot_node(new ident(tname),new ident("Item" + (i + 1).ToString())),
|
||||||
assvartup.vars.variables[i].source_context
|
assvartup.vars.variables[i].source_context
|
||||||
);
|
);
|
||||||
//visit(a); // Остальные элементы обходить не надо - они обходятся на следующих итерациях при обходе внешнего statement_list
|
// Остальные элементы обходить не надо (!!!уже надо!) - они обходятся на следующих итерациях при обходе внешнего statement_list
|
||||||
|
//visit(a);
|
||||||
sl.Add(a);
|
sl.Add(a);
|
||||||
}
|
}
|
||||||
ReplaceStatementUsingParent(assvartup, sl);
|
ReplaceStatementUsingParent(assvartup, sl);
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -2188,15 +2188,6 @@
|
||||||
</i>
|
</i>
|
||||||
</OCtx>
|
</OCtx>
|
||||||
</Node>
|
</Node>
|
||||||
<Node Name="Операции для List<T>, Dictionary<T> и т.д.">
|
|
||||||
<FileName>\PABCSystem.pas</FileName>
|
|
||||||
<Text>function List<T>.operator+=(var Self: List<T>; x: T): List<T>;</Text>
|
|
||||||
<OCtx>
|
|
||||||
<i Type="Method">function List < T > . operator + = ( var Self : List < T > ; x : T ) : List < T ></i>
|
|
||||||
<i Type="PAS_TreeNode">
|
|
||||||
</i>
|
|
||||||
</OCtx>
|
|
||||||
</Node>
|
|
||||||
<Node Name="Операции для HashSet, SortedSet">
|
<Node Name="Операции для HashSet, SortedSet">
|
||||||
<FileName>\PABCSystem.pas</FileName>
|
<FileName>\PABCSystem.pas</FileName>
|
||||||
<Text>function HashSet<T>.operator in(x: T; Self: HashSet<T>): boolean;</Text>
|
<Text>function HashSet<T>.operator in(x: T; Self: HashSet<T>): boolean;</Text>
|
||||||
|
|
@ -2206,6 +2197,108 @@
|
||||||
</i>
|
</i>
|
||||||
</OCtx>
|
</OCtx>
|
||||||
</Node>
|
</Node>
|
||||||
|
<Node Name="Операции для Tuple">
|
||||||
|
<FileName>\PABCSystem.pas</FileName>
|
||||||
|
<Text>// Операции для Tuple</Text>
|
||||||
|
<OCtx>
|
||||||
|
<i Type="Method">function Low ( self : System . Array ) extensionmethod : = Low ( Self )</i>
|
||||||
|
<i Type="Method">function High ( self : System . Array ) extensionmethod : = High ( Self )</i>
|
||||||
|
<i Type="PAS_TreeNode">
|
||||||
|
</i>
|
||||||
|
</OCtx>
|
||||||
|
<ICtx>
|
||||||
|
<i Type="Method">function CreateSliceFromArrayInternal < T > ( Self : array of T ; from , step , count : integer ) : array of T</i>
|
||||||
|
<i Type="Method">function SliceArrayImpl < T > ( Self : array of T ; from , step , count : integer ) : array of T</i>
|
||||||
|
<i Type="Method">function Slice < T > ( Self : array of T ; from , step : integer ) : array of T extensionmethod</i>
|
||||||
|
<i Type="Method">function Slice < T > ( Self : array of T ; from , step , count : integer ) : array of T extensionmethod</i>
|
||||||
|
<i Type="Method">function SystemSliceArrayImpl < T > ( Self : array of T ; situation : integer ; from , &to : integer ; step : integer : = 1 ) : array of T</i>
|
||||||
|
<i Type="Method">function SystemSlice < T > ( Self : array of T ; situation : integer ; from , &to : integer ) : array of T extensionmethod</i>
|
||||||
|
<i Type="Method">function SystemSlice < T > ( Self : array of T ; situation : integer ; from , &to , step : integer ) : array of T extensionmethod</i>
|
||||||
|
<i Type="Method">function SystemSliceArrayImplQuestion < T > ( Self : array of T ; situation : integer ; from , &to : integer ; step : integer : = 1 ) : array of T</i>
|
||||||
|
<i Type="Method">function SystemSliceQuestion < T > ( Self : array of T ; situation : integer ; from , &to : integer ) : array of T extensionmethod</i>
|
||||||
|
<i Type="Method">function SystemSliceQuestion < T > ( Self : array of T ; situation : integer ; from , &to , step : integer ) : array of T extensionmethod</i>
|
||||||
|
</ICtx>
|
||||||
|
</Node>
|
||||||
|
<Node Name="Операции для List<T> ">
|
||||||
|
<FileName>\PABCSystem.pas</FileName>
|
||||||
|
<Text>// Операции для List<T></Text>
|
||||||
|
<OCtx>
|
||||||
|
<i Type="PAS_TreeNode">
|
||||||
|
</i>
|
||||||
|
</OCtx>
|
||||||
|
<ICtx>
|
||||||
|
<i Type="Field">unit PABCSystem</i>
|
||||||
|
<i Type="Field">uses System . Runtime . InteropServices , System . IO , System . Collections , System . Collections . Generic , System</i>
|
||||||
|
<i Type="Field">MaxShortInt = shortint . MaxValue</i>
|
||||||
|
<i Type="Field">MaxByte = byte . MaxValue</i>
|
||||||
|
<i Type="Field">MaxSmallInt = smallint . MaxValue</i>
|
||||||
|
<i Type="Field">MaxWord = word . MaxValue</i>
|
||||||
|
<i Type="Field">MaxLongWord = longword . MaxValue</i>
|
||||||
|
<i Type="Field">MaxInt64 = int64 . MaxValue</i>
|
||||||
|
<i Type="Field">MaxUInt64 = uint64 . MaxValue</i>
|
||||||
|
<i Type="Field">MaxDouble = real . MaxValue</i>
|
||||||
|
</ICtx>
|
||||||
|
</Node>
|
||||||
|
<Node Name="Операции для HashSet<T> ">
|
||||||
|
<FileName>\PABCSystem.pas</FileName>
|
||||||
|
<Text>// Операции для HashSet<T></Text>
|
||||||
|
<OCtx>
|
||||||
|
<i Type="PAS_TreeNode">
|
||||||
|
</i>
|
||||||
|
</OCtx>
|
||||||
|
<ICtx>
|
||||||
|
<i Type="Field">unit PABCSystem</i>
|
||||||
|
<i Type="Field">uses System . Runtime . InteropServices , System . IO , System . Collections , System . Collections . Generic , System</i>
|
||||||
|
<i Type="Field">MaxShortInt = shortint . MaxValue</i>
|
||||||
|
<i Type="Field">MaxByte = byte . MaxValue</i>
|
||||||
|
<i Type="Field">MaxSmallInt = smallint . MaxValue</i>
|
||||||
|
<i Type="Field">MaxWord = word . MaxValue</i>
|
||||||
|
<i Type="Field">MaxLongWord = longword . MaxValue</i>
|
||||||
|
<i Type="Field">MaxInt64 = int64 . MaxValue</i>
|
||||||
|
<i Type="Field">MaxUInt64 = uint64 . MaxValue</i>
|
||||||
|
<i Type="Field">MaxDouble = real . MaxValue</i>
|
||||||
|
</ICtx>
|
||||||
|
</Node>
|
||||||
|
<Node Name="Операции для SortedSet<T> ">
|
||||||
|
<FileName>\PABCSystem.pas</FileName>
|
||||||
|
<Text>// Операции для SortedSet<T></Text>
|
||||||
|
<OCtx>
|
||||||
|
<i Type="PAS_TreeNode">
|
||||||
|
</i>
|
||||||
|
</OCtx>
|
||||||
|
<ICtx>
|
||||||
|
<i Type="Field">unit PABCSystem</i>
|
||||||
|
<i Type="Field">uses System . Runtime . InteropServices , System . IO , System . Collections , System . Collections . Generic , System</i>
|
||||||
|
<i Type="Field">MaxShortInt = shortint . MaxValue</i>
|
||||||
|
<i Type="Field">MaxByte = byte . MaxValue</i>
|
||||||
|
<i Type="Field">MaxSmallInt = smallint . MaxValue</i>
|
||||||
|
<i Type="Field">MaxWord = word . MaxValue</i>
|
||||||
|
<i Type="Field">MaxLongWord = longword . MaxValue</i>
|
||||||
|
<i Type="Field">MaxInt64 = int64 . MaxValue</i>
|
||||||
|
<i Type="Field">MaxUInt64 = uint64 . MaxValue</i>
|
||||||
|
<i Type="Field">MaxDouble = real . MaxValue</i>
|
||||||
|
</ICtx>
|
||||||
|
</Node>
|
||||||
|
<Node Name="Операции для Dictionary<K,V>, SortedDictionary<K,V>, SortedList<K,V>">
|
||||||
|
<FileName>\PABCSystem.pas</FileName>
|
||||||
|
<Text>// Операции для Dictionary<K,V>, SortedDictionary<K,V>, SortedList<K,V></Text>
|
||||||
|
<OCtx>
|
||||||
|
<i Type="PAS_TreeNode">
|
||||||
|
</i>
|
||||||
|
</OCtx>
|
||||||
|
<ICtx>
|
||||||
|
<i Type="Field">unit PABCSystem</i>
|
||||||
|
<i Type="Field">uses System . Runtime . InteropServices , System . IO , System . Collections , System . Collections . Generic , System</i>
|
||||||
|
<i Type="Field">MaxShortInt = shortint . MaxValue</i>
|
||||||
|
<i Type="Field">MaxByte = byte . MaxValue</i>
|
||||||
|
<i Type="Field">MaxSmallInt = smallint . MaxValue</i>
|
||||||
|
<i Type="Field">MaxWord = word . MaxValue</i>
|
||||||
|
<i Type="Field">MaxLongWord = longword . MaxValue</i>
|
||||||
|
<i Type="Field">MaxInt64 = int64 . MaxValue</i>
|
||||||
|
<i Type="Field">MaxUInt64 = uint64 . MaxValue</i>
|
||||||
|
<i Type="Field">MaxDouble = real . MaxValue</i>
|
||||||
|
</ICtx>
|
||||||
|
</Node>
|
||||||
</Items>
|
</Items>
|
||||||
</Node>
|
</Node>
|
||||||
<Node Name="BigInteger">
|
<Node Name="BigInteger">
|
||||||
|
|
|
||||||
|
|
@ -9808,41 +9808,49 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator=<T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator=<T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := Self.Equals( v ) ;
|
||||||
begin
|
///--
|
||||||
Result := Self.Equals( v ) ;
|
function operator<><T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := not Self.Equals( v );
|
||||||
end;
|
///--
|
||||||
|
function CompareToTup2<T1,T2>(v1: (T1,T2); v2: (T1,T2)) := (v1 as System.IComparable).CompareTo(v2);
|
||||||
|
///--
|
||||||
|
function operator<<T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := CompareToTup2(Self,v) < 0;
|
||||||
|
///--
|
||||||
|
function operator<=<T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := CompareToTup2(Self,v) <= 0;
|
||||||
|
///--
|
||||||
|
function operator><T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := CompareToTup2(Self,v) > 0;
|
||||||
|
///--
|
||||||
|
function operator>=<T1, T2> (Self: (T1,T2); v: (T1,T2)); extensionmethod := CompareToTup2(Self,v) >= 0;
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator<><T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator=<T1, T2, T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := Self.Equals( v ) ;
|
||||||
begin
|
///--
|
||||||
Result := not Self.Equals( v ) ;
|
function operator<><T1, T2, T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := not Self.Equals( v );
|
||||||
end;
|
///--
|
||||||
|
function CompareToTup3<T1,T2,T3>(v1: (T1,T2,T3); v2: (T1,T2,T3)) := (v1 as System.IComparable).CompareTo(v2);
|
||||||
|
///--
|
||||||
|
function operator<<T1,T2,T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := CompareToTup3(Self,v) < 0;
|
||||||
|
///--
|
||||||
|
function operator<=<T1,T2,T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := CompareToTup3(Self,v) <= 0;
|
||||||
|
///--
|
||||||
|
function operator><T1,T2,T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := CompareToTup3(Self,v) > 0;
|
||||||
|
///--
|
||||||
|
function operator>=<T1,T2,T3> (Self: (T1,T2,T3); v: (T1,T2,T3)); extensionmethod := CompareToTup3(Self,v) >= 0;
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator<<T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator=<T1, T2, T3, T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := Self.Equals( v ) ;
|
||||||
begin
|
|
||||||
Result := (Self as System.IComparable).CompareTo( v ) < 0 ;
|
|
||||||
end;
|
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator<=<T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator<><T1, T2, T3, T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := not Self.Equals( v );
|
||||||
begin
|
|
||||||
Result := (Self as System.IComparable).CompareTo( v ) <= 0 ;
|
|
||||||
end;
|
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator><T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function CompareToTup4<T1,T2,T3,T4>(v1: (T1,T2,T3,T4); v2: (T1,T2,T3,T4)) := (v1 as System.IComparable).CompareTo(v2);
|
||||||
begin
|
|
||||||
Result := (Self as System.IComparable).CompareTo( v ) > 0 ;
|
|
||||||
end;
|
|
||||||
|
|
||||||
///--
|
///--
|
||||||
function operator>=<T1, T2> (Self: (T1,T2); v: (T1,T2)): boolean; extensionmethod;
|
function operator<<T1,T2,T3,T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := CompareToTup4(Self,v) < 0;
|
||||||
begin
|
///--
|
||||||
Result := (Self as System.IComparable).CompareTo( v ) >= 0 ;
|
function operator<=<T1,T2,T3,T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := CompareToTup4(Self,v) <= 0;
|
||||||
end;
|
///--
|
||||||
|
function operator><T1,T2,T3,T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := CompareToTup4(Self,v) > 0;
|
||||||
|
///--
|
||||||
|
function operator>=<T1,T2,T3,T4> (Self: (T1,T2,T3,T4); v: (T1,T2,T3,T4)); extensionmethod := CompareToTup4(Self,v) >= 0;
|
||||||
|
|
||||||
// --------------------------------------------
|
// --------------------------------------------
|
||||||
// Методы расширения типа Tuple # Extension methods for Tuple
|
// Методы расширения типа Tuple # Extension methods for Tuple
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue