mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 14:08:05 +02:00
fcl-passrc: clean up
git-svn-id: trunk@42291 -
This commit is contained in:
parent
02b66457f5
commit
ec3c050ac7
@ -14369,6 +14369,19 @@ end;
|
||||
|
||||
procedure TPasResolver.BI_LowHigh_OnEval(Proc: TResElDataBuiltInProc;
|
||||
Params: TParamsExpr; Flags: TResEvalFlags; out Evaluated: TResEvalValue);
|
||||
|
||||
function IsDynArrayConstExpr(IdentEl: TPasElement): boolean;
|
||||
begin
|
||||
Result:=false;
|
||||
if not (IdentEl is TPasVariable) then exit;
|
||||
if not (TPasVariable(IdentEl).Expr is TPasExpr) then exit;
|
||||
|
||||
if (IdentEl.ClassType=TPasConst) and TPasConst(IdentEl).IsConst then
|
||||
exit(true);
|
||||
if fExprEvaluator.IsConst(Params) then
|
||||
exit(true); // a const refers an initial value
|
||||
end;
|
||||
|
||||
var
|
||||
Param: TPasExpr;
|
||||
ParamResolved: TPasResolverResult;
|
||||
@ -14398,8 +14411,7 @@ begin
|
||||
// dyn or open array
|
||||
if Proc.BuiltIn=bfLow then
|
||||
Evaluated:=TResEvalInt.CreateValue(0)
|
||||
else if (ParamResolved.IdentEl is TPasVariable)
|
||||
and (TPasVariable(ParamResolved.IdentEl).Expr is TPasExpr) then
|
||||
else if IsDynArrayConstExpr(ParamResolved.IdentEl) then
|
||||
begin
|
||||
Expr:=TPasVariable(ParamResolved.IdentEl).Expr;
|
||||
if Expr is TArrayValues then
|
||||
|
@ -511,7 +511,9 @@ Function TokenToAssignKind( tk : TToken) : TAssignKind;
|
||||
|
||||
implementation
|
||||
|
||||
{$IF FPC_FULLVERSION>=30301}
|
||||
uses strutils;
|
||||
{$ENDIF}
|
||||
|
||||
const
|
||||
WhitespaceTokensToIgnore = [tkWhitespace, tkComment, tkLineEnding, tkTab];
|
||||
@ -711,7 +713,6 @@ function ParseSource(AEngine: TPasTreeContainer;
|
||||
var
|
||||
FileResolver: TBaseFileResolver;
|
||||
Parser: TPasParser;
|
||||
Start, CurPos: integer; // in FPCCommandLine
|
||||
Filename: String;
|
||||
Scanner: TPascalScanner;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user