Browse Source

* Patch from Anton fixing several constant expressions mantis 19409

git-svn-id: trunk@17550 -
marco 14 years ago
parent
commit
c1498aade1
1 changed files with 10 additions and 4 deletions
  1. 10 4
      packages/fcl-passrc/src/pastree.pp

+ 10 - 4
packages/fcl-passrc/src/pastree.pp

@@ -2640,13 +2640,17 @@ Var
   I : Integer;
   I : Integer;
 
 
 begin
 begin
+  Result := '';
   For I:=0 to High(Params) do
   For I:=0 to High(Params) do
     begin
     begin
     If (Result<>'')  then
     If (Result<>'')  then
       Result:=Result+', ';
       Result:=Result+', ';
     Result:=Result+Params[I].GetDeclaration(Full);  
     Result:=Result+Params[I].GetDeclaration(Full);  
-    end;  
-  Result:='('+Result+')';
+    end;
+  if Kind = pekSet then
+    Result := '[' + Result + ']'
+  else
+    Result := '(' + Result + ')';
 end;
 end;
 
 
 procedure TParamsExpr.AddParam(xp:TPasExpr);
 procedure TParamsExpr.AddParam(xp:TPasExpr);
@@ -2678,9 +2682,10 @@ Function TRecordValues.GetDeclaration(Full : Boolean):AnsiString;
 Var
 Var
   I : Integer;
   I : Integer;
 begin
 begin
+  Result := '';
   For I:=0 to High(Fields) do
   For I:=0 to High(Fields) do
     begin
     begin
-    If Result='' then
+    If Result<>'' then
       Result:=Result+'; ';
       Result:=Result+'; ';
     Result:=Result+Fields[I].Name+': '+Fields[i].ValueExp.getDeclaration(Full);
     Result:=Result+Fields[I].Name+': '+Fields[i].ValueExp.getDeclaration(Full);
     end;
     end;
@@ -2739,9 +2744,10 @@ Var
   I : Integer;
   I : Integer;
 
 
 begin
 begin
+  Result := '';
   For I:=0 to High(Values) do
   For I:=0 to High(Values) do
     begin
     begin
-    If Result='' then
+    If Result<>'' then
       Result:=Result+', ';
       Result:=Result+', ';
     Result:=Result+Values[i].getDeclaration(Full);
     Result:=Result+Values[i].getDeclaration(Full);
     end;
     end;