mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 16:19:21 +02:00
fcl-passrc: similar to r36619. New option SemicolonAtEOL for better control of TPasImplCommand (previously, semicolon was implicitly added for command for generated pascal code by paswrite.pp module for TPasImplCommand)
git-svn-id: trunk@36621 -
This commit is contained in:
parent
ad65ff5600
commit
99f7c010a8
@ -1108,8 +1108,11 @@ Type
|
|||||||
{ TPasImplCommand - currently used as empty statement, e.g. if then else ; }
|
{ TPasImplCommand - currently used as empty statement, e.g. if then else ; }
|
||||||
|
|
||||||
TPasImplCommand = class(TPasImplElement)
|
TPasImplCommand = class(TPasImplElement)
|
||||||
|
public
|
||||||
|
constructor Create(const AName: string; AParent: TPasElement); override;
|
||||||
public
|
public
|
||||||
Command: string; // never set by TPasParser
|
Command: string; // never set by TPasParser
|
||||||
|
SemicolonAtEOL: boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TPasImplCommands - used by mkxmlrpc, not used by pparser }
|
{ TPasImplCommands - used by mkxmlrpc, not used by pparser }
|
||||||
@ -1521,6 +1524,14 @@ begin
|
|||||||
El:=nil;
|
El:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TPasImplCommand }
|
||||||
|
|
||||||
|
constructor TPasImplCommand.Create(const AName: string; AParent: TPasElement);
|
||||||
|
begin
|
||||||
|
inherited Create(AName, AParent);
|
||||||
|
SemicolonAtEOL := true;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TInlineTypeExpr }
|
{ TInlineTypeExpr }
|
||||||
|
|
||||||
destructor TInlineTypeExpr.Destroy;
|
destructor TInlineTypeExpr.Destroy;
|
||||||
|
@ -458,8 +458,13 @@ begin
|
|||||||
for i := 0 to ABlock.Elements.Count - 1 do
|
for i := 0 to ABlock.Elements.Count - 1 do
|
||||||
begin
|
begin
|
||||||
WriteImplElement(TPasImplElement(ABlock.Elements[i]), False);
|
WriteImplElement(TPasImplElement(ABlock.Elements[i]), False);
|
||||||
if TPasImplElement(ABlock.Elements[i]).ClassType = TPasImplCommand then
|
if (TPasImplElement(ABlock.Elements[i]).ClassType = TPasImplCommand) then
|
||||||
wrtln(';');
|
begin
|
||||||
|
if TPasImplCommand(ABlock.Elements[i]).SemicolonAtEOL then
|
||||||
|
wrtln(';')
|
||||||
|
else
|
||||||
|
wrtln;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user