mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-05 13:56:00 +02:00
codetools: h2p: implemented writing simple procedure param lists as pascal
git-svn-id: trunk@14619 -
This commit is contained in:
parent
fde5bd6197
commit
0187d5938a
@ -953,6 +953,9 @@ var
|
|||||||
H2PNode: TH2PNode;
|
H2PNode: TH2PNode;
|
||||||
UsesClause: String;
|
UsesClause: String;
|
||||||
PascalCode: String;
|
PascalCode: String;
|
||||||
|
ChildNode: TH2PNode;
|
||||||
|
CurName: String;
|
||||||
|
NoNameCount: Integer;
|
||||||
begin
|
begin
|
||||||
IndentStr:='';
|
IndentStr:='';
|
||||||
|
|
||||||
@ -1010,8 +1013,23 @@ begin
|
|||||||
// global procedure
|
// global procedure
|
||||||
SetSection(ctnNone);
|
SetSection(ctnNone);
|
||||||
PascalCode:='';
|
PascalCode:='';
|
||||||
if H2PNode.FirstChild<>nil then begin
|
ChildNode:=H2PNode.FirstChild;
|
||||||
|
NoNameCount:=0;
|
||||||
|
while ChildNode<>nil do begin
|
||||||
|
if ChildNode.PascalDesc=ctnVarDefinition then begin
|
||||||
|
if PascalCode<>'' then
|
||||||
|
PascalCode:=PascalCode+'; ';
|
||||||
|
CurName:=ChildNode.PascalName;
|
||||||
|
if CurName='' then begin
|
||||||
|
inc(NoNameCount);
|
||||||
|
CurName:='param'+IntToStr(NoNameCount)
|
||||||
|
+CreatePascalNameFromCCode(ChildNode.PascalCode);
|
||||||
|
end;
|
||||||
|
PascalCode:=PascalCode+CurName+': '+ChildNode.PascalCode;
|
||||||
|
end else begin
|
||||||
|
DebugLn(['TH2PasTool.WritePascalToStream SKIPPING ',ChildNode.DescAsString]);
|
||||||
|
end;
|
||||||
|
ChildNode:=ChildNode.NextBrother;
|
||||||
end;
|
end;
|
||||||
if PascalCode<>'' then
|
if PascalCode<>'' then
|
||||||
PascalCode:='('+PascalCode+')';
|
PascalCode:='('+PascalCode+')';
|
||||||
|
Loading…
Reference in New Issue
Block a user