|
@@ -105,6 +105,7 @@ uses
|
|
found,
|
|
found,
|
|
first,
|
|
first,
|
|
err : boolean;
|
|
err : boolean;
|
|
|
|
+ errval,
|
|
i,
|
|
i,
|
|
gencount : longint;
|
|
gencount : longint;
|
|
crc : cardinal;
|
|
crc : cardinal;
|
|
@@ -198,6 +199,7 @@ uses
|
|
(srsym.typ<>typesym) then
|
|
(srsym.typ<>typesym) then
|
|
begin
|
|
begin
|
|
identifier_not_found(genname);
|
|
identifier_not_found(genname);
|
|
|
|
+ tt:=generrordef;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
tt:=ttypesym(srsym).typedef;
|
|
tt:=ttypesym(srsym).typedef;
|
|
@@ -224,18 +226,17 @@ uses
|
|
if err then
|
|
if err then
|
|
begin
|
|
begin
|
|
try_to_consume(_RSHARPBRACKET);
|
|
try_to_consume(_RSHARPBRACKET);
|
|
|
|
+ tt:=generrordef;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
|
|
|
|
- { search a generic with the given count of params }
|
|
|
|
- countstr:='';
|
|
|
|
- str(genericdeflist.Count,countstr);
|
|
|
|
{ use the name of the symbol as procvars return a user friendly version
|
|
{ use the name of the symbol as procvars return a user friendly version
|
|
of the name }
|
|
of the name }
|
|
if symname='' then
|
|
if symname='' then
|
|
genname:=ttypesym(genericdef.typesym).realname
|
|
genname:=ttypesym(genericdef.typesym).realname
|
|
else
|
|
else
|
|
genname:=symname;
|
|
genname:=symname;
|
|
|
|
+
|
|
{ in case of non-Delphi mode the type name could already be a generic
|
|
{ in case of non-Delphi mode the type name could already be a generic
|
|
def (but maybe the wrong one) }
|
|
def (but maybe the wrong one) }
|
|
if assigned(genericdef) and
|
|
if assigned(genericdef) and
|
|
@@ -257,7 +258,27 @@ uses
|
|
genname:=copy(genname,1,i-1);
|
|
genname:=copy(genname,1,i-1);
|
|
break;
|
|
break;
|
|
end;
|
|
end;
|
|
- end;
|
|
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ { search for a potential suffix }
|
|
|
|
+ for i:=length(genname) downto 1 do
|
|
|
|
+ if genname[i]='$' then
|
|
|
|
+ begin
|
|
|
|
+ { if the part right of the $ is a number we assume that the left
|
|
|
|
+ part is the name of the generic, otherwise we assume that the
|
|
|
|
+ complete name is the name of the generic }
|
|
|
|
+ countstr:=copy(genname,i+1,length(genname)-i);
|
|
|
|
+ gencount:=0;
|
|
|
|
+ val(countstr,gencount,errval);
|
|
|
|
+ if errval=0 then
|
|
|
|
+ genname:=copy(genname,1,i-1);
|
|
|
|
+ break;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ { search a generic with the given count of params }
|
|
|
|
+ countstr:='';
|
|
|
|
+ str(genericdeflist.Count,countstr);
|
|
|
|
+
|
|
genname:=genname+'$'+countstr;
|
|
genname:=genname+'$'+countstr;
|
|
ugenname:=upper(genname);
|
|
ugenname:=upper(genname);
|
|
|
|
|
|
@@ -276,6 +297,7 @@ uses
|
|
identifier_not_found(genname);
|
|
identifier_not_found(genname);
|
|
genericdeflist.Free;
|
|
genericdeflist.Free;
|
|
generictypelist.Free;
|
|
generictypelist.Free;
|
|
|
|
+ tt:=generrordef;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -317,7 +339,6 @@ uses
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-
|
|
|
|
{ Special case if we are referencing the current defined object }
|
|
{ Special case if we are referencing the current defined object }
|
|
if assigned(current_structdef) and
|
|
if assigned(current_structdef) and
|
|
(current_structdef.objname^=ufinalspecializename) then
|
|
(current_structdef.objname^=ufinalspecializename) then
|