TfpExtressionParser: bugs in aggregates min, max, sum, avg, count
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
TfpExtressionParser is not able to parse the above aggregates correctly
Steps to reproduce:
{$mode delphi}
uses
sysutils, fpexprpars,math;
var
FParser: TFPExpressionParser;
begin
FParser := TFPExpressionParser.Create(nil);
try
FParser.Builtins :=[bcStrings,bcDateTime,bcMath,bcBoolean,bcConversion,bcData,bcVaria,bcUser,bcAggregate];
try
writeln(8 mod 3);
FParser.Expression := '8 mod 3'; // mod works in trunk
FParser.Evaluate;
writeln(FParser.AsInteger);
except
On E:EExprParser do
writeln(E.Message)
else Raise;
end;
try
writeln(min(3,5));
FParser.Expression := 'min(3,5)'; // but this fails
FParser.Evaluate;
writeln(FParser.AsInteger);
except
on E:EExprParser do
writeln(E.Message)
else Raise;
end;
finally
FParser.Free;
end;
end.
Additional information:
See discussion here: https://forum.lazarus.freepascal.org/index.php/topic,19627.msg340744.html#msg340744
Mantis conversion info:
- Mantis ID: 36366
- OS: all
- OS Build: all
- Build: 43592
- Platform: all
- Version: 3.3.1