Skip to content

Commit

Permalink
Updated TemplatePro
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Nov 26, 2024
1 parent e78f525 commit 0592496
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions sources/TemplatePro.pas
Original file line number Diff line number Diff line change
Expand Up @@ -494,28 +494,6 @@ function TTProCompiledTemplate.ComparandOperator(const aComparandType: TComparan
end;
end;

function _eq(const aValue: TValue; const aParameters: TArray<String>; const aLocaleFormatSettings: TFormatSettings): TValue;
var
lStrValue: string;
begin
if Length(aParameters) <> 1 then
FunctionError('eq/ne', 'expected 1 parameter');
if aValue.IsType<String> then
Result := aValue.AsString = aParameters[0]
else if aValue.IsType<Int64> then
Result := aValue.AsInt64 = StrToInt(aParameters[0])
else if aValue.IsType<Integer> then
Result := aValue.AsInteger = StrToInt64(aParameters[0])
else if aValue.IsType<TDateTime> then
begin
lStrValue := DateTimeToStr(TDate(aValue.AsExtended), aLocaleFormatSettings);
Result := lStrValue = aParameters[0];
end
else
FunctionError('eq/ne', 'Unsupported param type for "' + String(aValue.TypeInfo.Name) + '"');
end;


{ TParser }

procedure TTProCompiledTemplate.AddFilter(const FunctionName: string; const FunctionImpl: TTProTemplateFunction);
Expand Down Expand Up @@ -919,8 +897,7 @@ procedure TTProCompiler.InternalMatchFilter(lIdentifier: String; var lStartVerba
begin
for I := 0 to lFilterParamsCount - 1 do
begin
raise Exception.Create('Error Message');
//aTokens.Add(TToken.Create(ttFilterParameter, lFilterParams[I], ''));
aTokens.Add(CreateFilterParameterToken(@lFilterParams[I]));
end;
end;
end;
Expand Down

0 comments on commit 0592496

Please sign in to comment.