mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 23:42:34 +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 = class(TPasImplElement)
|
||||
public
|
||||
constructor Create(const AName: string; AParent: TPasElement); override;
|
||||
public
|
||||
Command: string; // never set by TPasParser
|
||||
SemicolonAtEOL: boolean;
|
||||
end;
|
||||
|
||||
{ TPasImplCommands - used by mkxmlrpc, not used by pparser }
|
||||
@ -1521,6 +1524,14 @@ begin
|
||||
El:=nil;
|
||||
end;
|
||||
|
||||
{ TPasImplCommand }
|
||||
|
||||
constructor TPasImplCommand.Create(const AName: string; AParent: TPasElement);
|
||||
begin
|
||||
inherited Create(AName, AParent);
|
||||
SemicolonAtEOL := true;
|
||||
end;
|
||||
|
||||
{ TInlineTypeExpr }
|
||||
|
||||
destructor TInlineTypeExpr.Destroy;
|
||||
|
@ -458,8 +458,13 @@ begin
|
||||
for i := 0 to ABlock.Elements.Count - 1 do
|
||||
begin
|
||||
WriteImplElement(TPasImplElement(ABlock.Elements[i]), False);
|
||||
if TPasImplElement(ABlock.Elements[i]).ClassType = TPasImplCommand then
|
||||
wrtln(';');
|
||||
if (TPasImplElement(ABlock.Elements[i]).ClassType = TPasImplCommand) then
|
||||
begin
|
||||
if TPasImplCommand(ABlock.Elements[i]).SemicolonAtEOL then
|
||||
wrtln(';')
|
||||
else
|
||||
wrtln;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user