@@ -377,7 +377,7 @@ function TVariableList.ToPascal(indent:Boolean): String;
377
377
else
378
378
if Indent then
379
379
// switched from list of consts to vars
380
- Result := Result.Trim + sLineBreak + sLineBreak + cDirPascal[Items[I].Dir]
380
+ Result := Result.Trim + sLineBreak +' ' + sLineBreak + ' ' + cDirPascal[Items[I].Dir]
381
381
else
382
382
Result := Result.Trim + cDirPascal[Items[I].Dir];
383
383
@@ -397,7 +397,7 @@ function TVariableList.ToPascal(indent:Boolean): String;
397
397
begin
398
398
Result := Result + Esc(Items[i].name .Trim) + ' , ' ;
399
399
if align then
400
- Result := Result + sLineBreak;
400
+ Result := Result + sLineBreak+ ' ' ;
401
401
continue;
402
402
end ;
403
403
@@ -429,11 +429,8 @@ function TVariableList.ToPascal(indent:Boolean): String;
429
429
430
430
// add a separator, unless it's the last argument
431
431
if i < Count - 1 then
432
- // if Result[high(Result)]<>';' then
433
432
Result := Result + ' ;' ;
434
433
435
- if Indent then
436
- Result := Result + sLineBreak+' ' ;
437
434
438
435
end ;
439
436
@@ -953,9 +950,20 @@ function TPascalUnit.toPascal: string;
953
950
{ TArrayDef }
954
951
955
952
function TArrayDef1D.ToPascal : string;
956
- var elms : string;
953
+ var elms : string; i:integer; it:TArray<string>;
957
954
begin
958
- elms := ' ' .Join(' , ' , Items); // concat all elements into a comma separated string
955
+ setlength(it,length(items));
956
+ for i := 0 to high(items) do
957
+ begin
958
+ it[i] := items[i];
959
+ if it[i].EndsWith(' .' ) then
960
+ it[i] := it[i] + ' 0' ;
961
+ if it[i].StartsWith(' .' ) then
962
+ it[i] := ' 0' +it[i];
963
+
964
+ end ;
965
+
966
+ elms := ' ' .Join(' , ' , it); // concat all elements into a comma separated string
959
967
elms := TRegEx.Replace(elms,' 0[xX]([\da-fA-F]+)' ,' \$\1' ,[ roMultiLine ]); // convert possible hex to pascal hex
960
968
elms := elms.Replace(' /*' ,' {' ).Replace(' */' ,' }' );
961
969
elms := WrapText(elms,sLineBreak+' ' ,[' ,' ],70 ); // wrap long lines
0 commit comments