|
@@ -877,7 +877,7 @@ type
|
|
function AddCommands: TPasImplCommands; // used by mkxmlrpc, not by pparser
|
|
function AddCommands: TPasImplCommands; // used by mkxmlrpc, not by pparser
|
|
function AddBeginBlock: TPasImplBeginBlock;
|
|
function AddBeginBlock: TPasImplBeginBlock;
|
|
function AddRepeatUntil: TPasImplRepeatUntil;
|
|
function AddRepeatUntil: TPasImplRepeatUntil;
|
|
- function AddIfElse(const ACondition: string): TPasImplIfElse;
|
|
|
|
|
|
+ function AddIfElse(const ACondition: TPasExpr): TPasImplIfElse;
|
|
function AddWhileDo(const ACondition: string): TPasImplWhileDo;
|
|
function AddWhileDo(const ACondition: string): TPasImplWhileDo;
|
|
function AddWithDo(const Expression: string): TPasImplWithDo;
|
|
function AddWithDo(const Expression: string): TPasImplWithDo;
|
|
function AddCaseOf(const Expression: string): TPasImplCaseOf;
|
|
function AddCaseOf(const Expression: string): TPasImplCaseOf;
|
|
@@ -933,9 +933,10 @@ type
|
|
procedure AddElement(Element: TPasImplElement); override;
|
|
procedure AddElement(Element: TPasImplElement); override;
|
|
function CloseOnSemicolon: boolean; override;
|
|
function CloseOnSemicolon: boolean; override;
|
|
public
|
|
public
|
|
- Condition: string;
|
|
|
|
|
|
+ ConditionExpr : TPasExpr;
|
|
IfBranch: TPasImplElement;
|
|
IfBranch: TPasImplElement;
|
|
ElseBranch: TPasImplElement; // can be nil
|
|
ElseBranch: TPasImplElement; // can be nil
|
|
|
|
+ Function Condition: string;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TPasImplWhileDo }
|
|
{ TPasImplWhileDo }
|
|
@@ -1812,6 +1813,7 @@ end;
|
|
|
|
|
|
destructor TPasImplIfElse.Destroy;
|
|
destructor TPasImplIfElse.Destroy;
|
|
begin
|
|
begin
|
|
|
|
+ FreeAndNil(ConditionExpr);
|
|
if Assigned(IfBranch) then
|
|
if Assigned(IfBranch) then
|
|
IfBranch.Release;
|
|
IfBranch.Release;
|
|
if Assigned(ElseBranch) then
|
|
if Assigned(ElseBranch) then
|
|
@@ -1841,6 +1843,12 @@ begin
|
|
Result:=ElseBranch<>nil;
|
|
Result:=ElseBranch<>nil;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function TPasImplIfElse.Condition: string;
|
|
|
|
+begin
|
|
|
|
+ If Assigned(ConditionExpr) then
|
|
|
|
+ Result:=ConditionExpr.GetDeclaration(True);
|
|
|
|
+end;
|
|
|
|
+
|
|
destructor TPasImplForLoop.Destroy;
|
|
destructor TPasImplForLoop.Destroy;
|
|
begin
|
|
begin
|
|
if Assigned(Variable) then
|
|
if Assigned(Variable) then
|
|
@@ -1908,10 +1916,10 @@ begin
|
|
AddElement(Result);
|
|
AddElement(Result);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TPasImplBlock.AddIfElse(const ACondition: string): TPasImplIfElse;
|
|
|
|
|
|
+function TPasImplBlock.AddIfElse(const ACondition: TPasExpr): TPasImplIfElse;
|
|
begin
|
|
begin
|
|
Result := TPasImplIfElse.Create('', Self);
|
|
Result := TPasImplIfElse.Create('', Self);
|
|
- Result.Condition := ACondition;
|
|
|
|
|
|
+ Result.ConditionExpr := ACondition;
|
|
AddElement(Result);
|
|
AddElement(Result);
|
|
end;
|
|
end;
|
|
|
|
|