mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 05:09:19 +02:00
fixed a few generation flaws
This commit is contained in:
parent
a3d3cd7b81
commit
09ec18f4d6
@ -276,7 +276,15 @@ begin
|
|||||||
begin
|
begin
|
||||||
s := procs.Strings[i];
|
s := procs.Strings[i];
|
||||||
j := Pos('//', s);
|
j := Pos('//', s);
|
||||||
if (Length(s) = 0) or ((j > 0) and (Trim(s)[1] = '/')) then
|
if (Length(s) = 0)
|
||||||
|
then
|
||||||
|
WriteLn(dest)
|
||||||
|
else
|
||||||
|
if (Pos('{', s) = 1)
|
||||||
|
then
|
||||||
|
WriteLn(dest,procs.Strings[i])
|
||||||
|
else
|
||||||
|
if ((j > 0) and (Trim(s)[1] = '/')) then
|
||||||
WriteLn(dest, s)
|
WriteLn(dest, s)
|
||||||
else if j = 0 then
|
else if j = 0 then
|
||||||
WriteLn(dest, s, ' ',Modifier)
|
WriteLn(dest, s, ' ',Modifier)
|
||||||
@ -294,16 +302,26 @@ begin
|
|||||||
for i := 0 to procs.Count - 1 do
|
for i := 0 to procs.Count - 1 do
|
||||||
begin
|
begin
|
||||||
s := Trim(procs.Strings[i]);
|
s := Trim(procs.Strings[i]);
|
||||||
j := Pos(':', s);
|
if (Pos('//', s) > 0)
|
||||||
s := Trim(Copy(s, 1, j - 1));
|
or (Pos('{', s) = 1)
|
||||||
if (Length(s) = 0) or (Pos('//', s) > 0) then continue;
|
then
|
||||||
WriteLn(dest, ' ', s, ' := GetProc(', libname, ', ''', s, ''');');
|
WriteLn(dest,procs.Strings[i])
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
j := Pos(':', s);
|
||||||
|
s := Trim(Copy(s, 1, j - 1));
|
||||||
|
if (Length(s) = 0)
|
||||||
|
then
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
WriteLn(dest, ' ', s, ' := GetProc(', libname, ', ''', s, ''');');
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure PrintProcStatic(var dest: Text; procs: TStringList; const Modifier: String);
|
procedure PrintProcStatic(var dest: Text; procs: TStringList; const Modifier: String);
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
i, j, k: Integer;
|
||||||
s: String;
|
s: String;
|
||||||
t: String;
|
t: String;
|
||||||
begin
|
begin
|
||||||
@ -317,13 +335,19 @@ begin
|
|||||||
begin
|
begin
|
||||||
// swap order of leading symbols and remove ':'
|
// swap order of leading symbols and remove ':'
|
||||||
t := Trim(procs.Strings[i]);
|
t := Trim(procs.Strings[i]);
|
||||||
j := Pos(':', s);
|
j := Pos(':', t);
|
||||||
t := Trim(Copy(t, 1, j - 1));
|
t := Trim(Copy(t, 1, j - 1));
|
||||||
|
|
||||||
|
j := Pos(':', s);
|
||||||
Delete(s,1,j);
|
Delete(s,1,j);
|
||||||
s := Trim(s);
|
s := Trim(s);
|
||||||
|
|
||||||
j := Pos('(', s);
|
j := Pos(';', s);
|
||||||
|
k := Pos('(', s);
|
||||||
|
if k>0 then if j>k then j := k;
|
||||||
|
k := Pos(':', s);
|
||||||
|
if k>0 then if j>k then j := k;
|
||||||
|
|
||||||
Insert(t,s,j);
|
Insert(t,s,j);
|
||||||
Insert(' ',s,j);
|
Insert(' ',s,j);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user