Replaced Count-Node by RTL-Function
This commit is contained in:
@@ -102,7 +102,6 @@ type
|
||||
IRecordLiteralNode = interface;
|
||||
ICreateSeriesNode = interface;
|
||||
IAddSeriesItemNode = interface;
|
||||
ISeriesLengthNode = interface;
|
||||
IRecurNode = interface;
|
||||
INopNode = interface;
|
||||
IPipeNode = interface;
|
||||
@@ -130,7 +129,6 @@ type
|
||||
akRecordLiteral,
|
||||
akCreateSeries,
|
||||
akAddSeriesItem,
|
||||
akSeriesLength,
|
||||
akRecur,
|
||||
akNop,
|
||||
akPipe
|
||||
@@ -178,7 +176,6 @@ type
|
||||
function AsRecordLiteral: IRecordLiteralNode;
|
||||
function AsCreateSeries: ICreateSeriesNode;
|
||||
function AsAddSeriesItem: IAddSeriesItemNode;
|
||||
function AsSeriesLength: ISeriesLengthNode;
|
||||
function AsRecur: IRecurNode;
|
||||
function AsNop: INopNode;
|
||||
function AsPipe: IPipeNode;
|
||||
@@ -532,17 +529,6 @@ type
|
||||
property Lookback: IAstNode read GetLookback;
|
||||
end;
|
||||
|
||||
[AstTag('Count')]
|
||||
[AstDoc('Returns the current number of elements in a series.')]
|
||||
[AstScriptExample('(count prices)')]
|
||||
[AstField(0, 'series', fkNode)]
|
||||
ISeriesLengthNode = interface(IAstTypedNode)
|
||||
{$region 'private'}
|
||||
function GetSeries: IIdentifierNode;
|
||||
{$endregion}
|
||||
property Series: IIdentifierNode read GetSeries;
|
||||
end;
|
||||
|
||||
[AstTag('Recur')]
|
||||
[AstDoc('Tail-recursive call to the current function.')]
|
||||
[AstScriptExample('(recur (- n 1))')]
|
||||
@@ -623,7 +609,6 @@ type
|
||||
function AsRecordLiteral: IRecordLiteralNode; virtual;
|
||||
function AsCreateSeries: ICreateSeriesNode; virtual;
|
||||
function AsAddSeriesItem: IAddSeriesItemNode; virtual;
|
||||
function AsSeriesLength: ISeriesLengthNode; virtual;
|
||||
function AsRecur: IRecurNode; virtual;
|
||||
function AsNop: INopNode; virtual;
|
||||
function AsPipe: IPipeNode; virtual;
|
||||
@@ -996,17 +981,6 @@ type
|
||||
function AsAddSeriesItem: IAddSeriesItemNode; override;
|
||||
end;
|
||||
|
||||
TSeriesLengthNode = class(TAstTypedNode, ISeriesLengthNode)
|
||||
private
|
||||
FSeries: IIdentifierNode;
|
||||
function GetSeries: IIdentifierNode;
|
||||
protected
|
||||
function GetKind: TAstNodeKind; override;
|
||||
public
|
||||
constructor Create(const ASeries: IIdentifierNode; const AStaticType: IStaticType; const AIdentity: IAstIdentity);
|
||||
function AsSeriesLength: ISeriesLengthNode; override;
|
||||
end;
|
||||
|
||||
TRecurNode = class(TAstTypedNode, IRecurNode)
|
||||
private
|
||||
FArguments: ITupleNode;
|
||||
@@ -1288,10 +1262,6 @@ function TAstNode.AsAddSeriesItem: IAddSeriesItemNode;
|
||||
begin
|
||||
Result := nil;
|
||||
end;
|
||||
function TAstNode.AsSeriesLength: ISeriesLengthNode;
|
||||
begin
|
||||
Result := nil;
|
||||
end;
|
||||
function TAstNode.AsRecur: IRecurNode;
|
||||
begin
|
||||
Result := nil;
|
||||
@@ -1992,27 +1962,6 @@ begin
|
||||
Result := Self;
|
||||
end;
|
||||
|
||||
{ TSeriesLengthNode }
|
||||
|
||||
constructor TSeriesLengthNode.Create(const ASeries: IIdentifierNode; const AStaticType: IStaticType; const AIdentity: IAstIdentity);
|
||||
begin
|
||||
inherited Create(AStaticType, AIdentity);
|
||||
FSeries := ASeries;
|
||||
end;
|
||||
|
||||
function TSeriesLengthNode.GetKind: TAstNodeKind;
|
||||
begin
|
||||
Result := akSeriesLength;
|
||||
end;
|
||||
function TSeriesLengthNode.GetSeries: IIdentifierNode;
|
||||
begin
|
||||
Result := FSeries;
|
||||
end;
|
||||
function TSeriesLengthNode.AsSeriesLength: ISeriesLengthNode;
|
||||
begin
|
||||
Result := Self;
|
||||
end;
|
||||
|
||||
{ TRecurNode }
|
||||
|
||||
constructor TRecurNode.Create(const AArguments: ITupleNode; const AStaticType: IStaticType; const AIdentity: IAstIdentity);
|
||||
|
||||
Reference in New Issue
Block a user