Ver código fonte

fcl-passrc: new option SemicolonAtEOL for better control of TPasImplCommands (previously, semicolon was implicitly added for each line for generated pascal code by paswrite.pp module for TPasImplCommands)

git-svn-id: trunk@36619 -
maciej-izak 8 anos atrás
pai
commit
aaf7f5137e

+ 2 - 0
packages/fcl-passrc/src/pastree.pp

@@ -1120,6 +1120,7 @@ Type
     destructor Destroy; override;
   public
     Commands: TStrings;
+    SemicolonAtEOL: boolean;
   end;
 
   { TPasLabels }
@@ -2927,6 +2928,7 @@ constructor TPasImplCommands.Create(const AName: string; AParent: TPasElement);
 begin
   inherited Create(AName, AParent);
   Commands := TStringList.Create;
+  SemicolonAtEOL := true;
 end;
 
 destructor TPasImplCommands.Destroy;

+ 4 - 1
packages/fcl-passrc/src/paswrite.pp

@@ -516,7 +516,10 @@ begin
       if (Length(s) >= 2) and (s[1] = '/') and (s[2] = '/') then
         wrtln(s)
       else
-        wrtln(s + ';');
+        if ACommands.SemicolonAtEOL then
+          wrtln(s + ';')
+        else
+          wrtln(s);
   end;
 end;