mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 01:09:40 +01:00
compiler: make current_genericdef, current_specializedef tstoreddef instead of tabstractrecorddef to implement generic arrays
git-svn-id: trunk@16671 -
This commit is contained in:
parent
52667b6822
commit
e8502b8ec2
@ -953,9 +953,9 @@ implementation
|
||||
|
||||
function object_dec(objecttype:tobjecttyp;const n:tidstring;genericdef:tstoreddef;genericlist:TFPObjectList;fd : tobjectdef) : tobjectdef;
|
||||
var
|
||||
old_current_structdef,
|
||||
old_current_structdef: tabstractrecorddef;
|
||||
old_current_genericdef,
|
||||
old_current_specializedef: tabstractrecorddef;
|
||||
old_current_specializedef: tstoreddef;
|
||||
begin
|
||||
old_current_structdef:=current_structdef;
|
||||
old_current_genericdef:=current_genericdef;
|
||||
|
||||
@ -802,9 +802,9 @@ implementation
|
||||
popclass : integer;
|
||||
ImplIntf : TImplementedInterface;
|
||||
old_parse_generic : boolean;
|
||||
old_current_structdef,
|
||||
old_current_structdef: tabstractrecorddef;
|
||||
old_current_genericdef,
|
||||
old_current_specializedef : tabstractrecorddef;
|
||||
old_current_specializedef: tstoreddef;
|
||||
lasttoken,lastidtoken: ttoken;
|
||||
|
||||
procedure parse_operator_name;
|
||||
@ -1189,9 +1189,9 @@ implementation
|
||||
var
|
||||
popclass: integer;
|
||||
old_parse_generic: boolean;
|
||||
old_current_structdef,
|
||||
old_current_structdef: tabstractrecorddef;
|
||||
old_current_genericdef,
|
||||
old_current_specializedef: tabstractrecorddef;
|
||||
old_current_specializedef: tstoreddef;
|
||||
begin
|
||||
old_parse_generic:=parse_generic;
|
||||
{ Add ObjectSymtable to be able to find generic type definitions }
|
||||
|
||||
@ -1388,9 +1388,9 @@ implementation
|
||||
old_current_procinfo : tprocinfo;
|
||||
old_block_type : tblock_type;
|
||||
st : TSymtable;
|
||||
old_current_structdef,
|
||||
old_current_structdef: tabstractrecorddef;
|
||||
old_current_genericdef,
|
||||
old_current_specializedef: tabstractrecorddef;
|
||||
old_current_specializedef: tstoreddef;
|
||||
begin
|
||||
old_current_procinfo:=current_procinfo;
|
||||
old_block_type:=block_type;
|
||||
@ -1655,9 +1655,9 @@ implementation
|
||||
|
||||
var
|
||||
old_current_procinfo : tprocinfo;
|
||||
old_current_structdef,
|
||||
old_current_structdef: tabstractrecorddef;
|
||||
old_current_genericdef,
|
||||
old_current_specializedef: tabstractrecorddef;
|
||||
old_current_specializedef: tstoreddef;
|
||||
pdflags : tpdflags;
|
||||
pd,firstpd : tprocdef;
|
||||
s : string;
|
||||
|
||||
@ -837,9 +837,9 @@ implementation
|
||||
{ reads a record declaration }
|
||||
function record_dec(const n:tidstring;genericdef:tstoreddef;genericlist:TFPObjectList):tdef;
|
||||
var
|
||||
old_current_structdef,
|
||||
old_current_structdef: tabstractrecorddef;
|
||||
old_current_genericdef,
|
||||
old_current_specializedef: tabstractrecorddef;
|
||||
old_current_specializedef: tstoreddef;
|
||||
old_parse_generic: boolean;
|
||||
recst: trecordsymtable;
|
||||
begin
|
||||
@ -1055,7 +1055,7 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure array_dec(is_packed: boolean);
|
||||
procedure array_dec(is_packed:boolean;genericdef:tstoreddef;genericlist:TFPObjectList);
|
||||
var
|
||||
lowval,
|
||||
highval : TConstExprInt;
|
||||
@ -1286,7 +1286,7 @@ implementation
|
||||
end;
|
||||
_ARRAY:
|
||||
begin
|
||||
array_dec(false);
|
||||
array_dec(false,genericdef,genericlist);
|
||||
end;
|
||||
_SET:
|
||||
begin
|
||||
@ -1312,7 +1312,7 @@ implementation
|
||||
(token = _BITPACKED);
|
||||
consume(token);
|
||||
if token=_ARRAY then
|
||||
array_dec(bitpacking)
|
||||
array_dec(bitpacking,genericdef,genericlist)
|
||||
else if token=_SET then
|
||||
set_dec
|
||||
else if token=_FILE then
|
||||
|
||||
@ -642,8 +642,8 @@ interface
|
||||
|
||||
var
|
||||
current_structdef: tabstractrecorddef; { used for private functions check !! }
|
||||
current_genericdef : tabstractrecorddef; { used to reject declaration of generic class inside generic class }
|
||||
current_specializedef : tabstractrecorddef; { used to implement usage of generic class in itself }
|
||||
current_genericdef: tstoreddef; { used to reject declaration of generic class inside generic class }
|
||||
current_specializedef: tstoreddef; { used to implement usage of generic class in itself }
|
||||
|
||||
{ default types }
|
||||
generrordef, { error in definition }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user