Browse Source

fcl-passrc: pastree: Move option SemicolonAtEOL to new more generic class TPasImplCommandBase

git-svn-id: trunk@36622 -
maciej-izak 8 years ago
parent
commit
8225588722
1 changed files with 11 additions and 8 deletions
  1. 11 8
      packages/fcl-passrc/src/pastree.pp

+ 11 - 8
packages/fcl-passrc/src/pastree.pp

@@ -1105,25 +1105,29 @@ Type
   TPasImplElement = class(TPasElement)
   end;
 
-  { TPasImplCommand - currently used as empty statement, e.g. if then else ; }
+  { TPasImplCommandBase }
 
-  TPasImplCommand = class(TPasImplElement)
+  TPasImplCommandBase = class(TPasImplElement)
   public
+    SemicolonAtEOL: boolean;
     constructor Create(const AName: string; AParent: TPasElement); override;
+  end;
+
+  { TPasImplCommand - currently used as empty statement, e.g. if then else ; }
+
+  TPasImplCommand = class(TPasImplCommandBase)
   public
     Command: string; // never set by TPasParser
-    SemicolonAtEOL: boolean;
   end;
 
   { TPasImplCommands - used by mkxmlrpc, not used by pparser }
 
-  TPasImplCommands = class(TPasImplElement)
+  TPasImplCommands = class(TPasImplCommandBase)
   public
     constructor Create(const AName: string; AParent: TPasElement); override;
     destructor Destroy; override;
   public
     Commands: TStrings;
-    SemicolonAtEOL: boolean;
   end;
 
   { TPasLabels }
@@ -1524,9 +1528,9 @@ begin
   El:=nil;
 end;
 
-{ TPasImplCommand }
+{ TPasImplCommandBase }
 
-constructor TPasImplCommand.Create(const AName: string; AParent: TPasElement);
+constructor TPasImplCommandBase.Create(const AName: string; AParent: TPasElement);
 begin
   inherited Create(AName, AParent);
   SemicolonAtEOL := true;
@@ -2939,7 +2943,6 @@ constructor TPasImplCommands.Create(const AName: string; AParent: TPasElement);
 begin
   inherited Create(AName, AParent);
   Commands := TStringList.Create;
-  SemicolonAtEOL := true;
 end;
 
 destructor TPasImplCommands.Destroy;