mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 21:10:28 +02:00
+ add a method to retrieve a copy of a specialization context
This commit is contained in:
parent
094a353d87
commit
3444b23c9a
@ -51,6 +51,7 @@ type
|
|||||||
symtable : tsymtable;
|
symtable : tsymtable;
|
||||||
constructor create;
|
constructor create;
|
||||||
destructor destroy;override;
|
destructor destroy;override;
|
||||||
|
function getcopy:tspecializationcontext;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -73,5 +74,28 @@ begin
|
|||||||
inherited destroy;
|
inherited destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function tspecializationcontext.getcopy:tspecializationcontext;
|
||||||
|
var
|
||||||
|
posinfo : pfileposinfo;
|
||||||
|
i : longint;
|
||||||
|
begin
|
||||||
|
result:=tspecializationcontext.create;
|
||||||
|
for i:=0 to paramlist.count-1 do
|
||||||
|
begin
|
||||||
|
result.paramlist.add(paramlist[i]);
|
||||||
|
end;
|
||||||
|
for i:=0 to poslist.count-1 do
|
||||||
|
begin
|
||||||
|
new(posinfo);
|
||||||
|
posinfo^:=pfileposinfo(poslist[i])^;
|
||||||
|
result.poslist.add(posinfo);
|
||||||
|
end;
|
||||||
|
result.prettyname:=prettyname;
|
||||||
|
result.specializename:=specializename;
|
||||||
|
result.genname:=genname;
|
||||||
|
result.sym:=sym;
|
||||||
|
result.symtable:=symtable;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user