Explorar el Código

* Write default value for parameters. Fixes issue #41145

Michaël Van Canneyt hace 1 mes
padre
commit
c8da8817bd
Se han modificado 2 ficheros con 6 adiciones y 0 borrados
  1. 4 0
      packages/fcl-passrc/src/pastree.pp
  2. 2 0
      packages/fcl-passrc/src/paswrite.pp

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

@@ -3812,7 +3812,11 @@ begin
     else
       Result:=ArgType.GetDeclaration(False);
     If Full and (Name<>'') then
+      begin
       Result:=SafeName+': '+Result;
+      if Value<>'' then            
+        Result:=Result+'='+Value;  
+      end;
     end
   else If Full then
     Result:=SafeName

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

@@ -850,6 +850,8 @@ begin
     Add(AccessNames[aArg.Access]+' ');
   Add(aArg.SafeName+' : ');
   WriteType(aArg.ArgType,False);
+  if aArg.Value<>'' then  
+    Add(' = '+aArg.Value);
 end;
 
 procedure TPasWriter.WriteOverloadedProc(aProc: TPasOverloadedProc; ForceBody: Boolean = False; NamePrefix : String = '');