Moved operator helpers
This commit is contained in:
@@ -239,6 +239,14 @@ type
|
||||
property TotalCount: Int64 read FTotalCount;
|
||||
end;
|
||||
|
||||
TBinaryOperatorHelper = record helper for TBinaryOperator
|
||||
function ToString: string;
|
||||
end;
|
||||
|
||||
TUnaryOperatorHelper = record helper for TUnaryOperator
|
||||
function ToString: string;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TScalarValue }
|
||||
@@ -1555,6 +1563,38 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TBinaryOperatorHelper }
|
||||
|
||||
function TBinaryOperatorHelper.ToString: string;
|
||||
begin
|
||||
case Self of
|
||||
boAdd: Result := '+';
|
||||
boSubtract: Result := '-';
|
||||
boMultiply: Result := '*';
|
||||
boDivide: Result := '/';
|
||||
boEqual: Result := '==';
|
||||
boNotEqual: Result := '!=';
|
||||
boLess: Result := '<';
|
||||
boGreater: Result := '>';
|
||||
boLessOrEqual: Result := '<=';
|
||||
boGreaterOrEqual: Result := '>=';
|
||||
else
|
||||
Result := '?';
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TUnaryOperatorHelper }
|
||||
|
||||
function TUnaryOperatorHelper.ToString: string;
|
||||
begin
|
||||
case Self of
|
||||
uoNegate: Result := '-';
|
||||
uoNot: Result := 'not';
|
||||
else
|
||||
Result := '?';
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
Assert(sizeof(TScalarValue) = 8);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user