mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-07 21:35:57 +02:00
* keep track of the fileposinfo for generic constraints
git-svn-id: trunk@44188 -
This commit is contained in:
parent
314c4552e5
commit
41a6957f7d
@ -1168,6 +1168,7 @@ uses
|
|||||||
doconsume : boolean;
|
doconsume : boolean;
|
||||||
constraintdata : tgenericconstraintdata;
|
constraintdata : tgenericconstraintdata;
|
||||||
old_block_type : tblock_type;
|
old_block_type : tblock_type;
|
||||||
|
fileinfo : tfileposinfo;
|
||||||
begin
|
begin
|
||||||
result:=tfphashobjectlist.create(false);
|
result:=tfphashobjectlist.create(false);
|
||||||
firstidx:=0;
|
firstidx:=0;
|
||||||
@ -1183,12 +1184,14 @@ uses
|
|||||||
result.add(orgpattern,generictype);
|
result.add(orgpattern,generictype);
|
||||||
end;
|
end;
|
||||||
consume(_ID);
|
consume(_ID);
|
||||||
|
fileinfo:=current_tokenpos;
|
||||||
if try_to_consume(_COLON) then
|
if try_to_consume(_COLON) then
|
||||||
begin
|
begin
|
||||||
if not allowconstraints then
|
if not allowconstraints then
|
||||||
Message(parser_e_generic_constraints_not_allowed_here);
|
Message(parser_e_generic_constraints_not_allowed_here);
|
||||||
{ construct a name which can be used for a type specification }
|
{ construct a name which can be used for a type specification }
|
||||||
constraintdata:=tgenericconstraintdata.create;
|
constraintdata:=tgenericconstraintdata.create;
|
||||||
|
constraintdata.fileinfo:=fileinfo;
|
||||||
defname:='';
|
defname:='';
|
||||||
str(current_module.deflist.count,defname);
|
str(current_module.deflist.count,defname);
|
||||||
defname:='$gendef'+defname;
|
defname:='$gendef'+defname;
|
||||||
@ -1305,6 +1308,7 @@ uses
|
|||||||
genconstraintdata:=tgenericconstraintdata.create;
|
genconstraintdata:=tgenericconstraintdata.create;
|
||||||
genconstraintdata.flags:=constraintdata.flags;
|
genconstraintdata.flags:=constraintdata.flags;
|
||||||
genconstraintdata.interfaces.assign(constraintdata.interfaces);
|
genconstraintdata.interfaces.assign(constraintdata.interfaces);
|
||||||
|
genconstraintdata.fileinfo:=constraintdata.fileinfo;
|
||||||
include(defoptions,df_genconstraint);
|
include(defoptions,df_genconstraint);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -50,6 +50,8 @@ interface
|
|||||||
interfaces : tfpobjectlist;
|
interfaces : tfpobjectlist;
|
||||||
interfacesderef : tfplist;
|
interfacesderef : tfplist;
|
||||||
flags : tgenericconstraintflags;
|
flags : tgenericconstraintflags;
|
||||||
|
{ only required while parsing }
|
||||||
|
fileinfo : tfileposinfo;
|
||||||
constructor create;
|
constructor create;
|
||||||
destructor destroy;override;
|
destructor destroy;override;
|
||||||
procedure ppuload(ppufile:tcompilerppufile);
|
procedure ppuload(ppufile:tcompilerppufile);
|
||||||
|
Loading…
Reference in New Issue
Block a user