mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 00:28:18 +02:00
codetools: fixed extract generic type param names, issue #37081, from Pascal Riekenberg
git-svn-id: branches/fixes_2_0@63490 -
This commit is contained in:
parent
c39bc40c24
commit
64ec2a7745
@ -838,7 +838,7 @@ function TPascalReaderTool.ExtractClassName(Node: TCodeTreeNode;
|
||||
var
|
||||
ParamsNode: TCodeTreeNode;
|
||||
ParamNode: TCodeTreeNode;
|
||||
First: Boolean;
|
||||
Params: String;
|
||||
begin
|
||||
Result:='';
|
||||
while Node<>nil do begin
|
||||
@ -856,22 +856,19 @@ begin
|
||||
// extract generic type param names
|
||||
if WithGenericParams then begin
|
||||
ParamsNode:=Node.FirstChild.NextBrother;
|
||||
First:=true;
|
||||
Params:='';
|
||||
while ParamsNode<>nil do begin
|
||||
if ParamsNode.Desc=ctnGenericParams then begin
|
||||
Result:='>'+Result;
|
||||
ParamNode:=ParamsNode.FirstChild;
|
||||
while ParamNode<>nil do begin
|
||||
if ParamNode.Desc=ctnGenericParameter then begin
|
||||
if First then
|
||||
First:=false
|
||||
else
|
||||
Result:=','+Result;
|
||||
Result:=GetIdentifier(@Src[ParamNode.StartPos])+Result;
|
||||
if Params<>'' then
|
||||
Params:=Params+',';
|
||||
Params:=Params+GetIdentifier(@Src[ParamNode.StartPos]);
|
||||
end;
|
||||
ParamNode:=ParamNode.NextBrother;
|
||||
end;
|
||||
Result:='<'+Result;
|
||||
Result:='<'+Params+'>'+Result;
|
||||
end;
|
||||
ParamsNode:=ParamsNode.NextBrother;
|
||||
end;
|
||||
|
@ -423,7 +423,7 @@ begin
|
||||
'{$mode delphi}',
|
||||
'interface',
|
||||
'type',
|
||||
' TBird<T: class> = class',
|
||||
' TBird<T: class;U> = class',
|
||||
' procedure DoIt;',
|
||||
' end;',
|
||||
'implementation',
|
||||
@ -436,12 +436,12 @@ begin
|
||||
'',
|
||||
' { TBird }',
|
||||
'',
|
||||
' TBird<T: class> = class',
|
||||
' TBird<T: class;U> = class',
|
||||
' procedure DoIt;',
|
||||
' end;',
|
||||
'implementation',
|
||||
'',
|
||||
'procedure TBird<T>.DoIt;',
|
||||
'procedure TBird<T, U>.DoIt;',
|
||||
'begin',
|
||||
'',
|
||||
'end;',
|
||||
|
Loading…
Reference in New Issue
Block a user