mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 18:09:15 +02:00
pdecsub.pas:
+ export parse_proc_dec_finish() from the unit pgenutil.pas: * adjust generate_specialization_phase2() to correctly specialize procdefs git-svn-id: trunk@31772 -
This commit is contained in:
parent
d15cdefc37
commit
96a9273fba
@ -79,6 +79,7 @@ interface
|
|||||||
procedure parse_record_proc_directives(pd:tabstractprocdef);
|
procedure parse_record_proc_directives(pd:tabstractprocdef);
|
||||||
function parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;isgeneric:boolean;genericdef:tdef;generictypelist:tfphashobjectlist;out pd:tprocdef):boolean;
|
function parse_proc_head(astruct:tabstractrecorddef;potype:tproctypeoption;isgeneric:boolean;genericdef:tdef;generictypelist:tfphashobjectlist;out pd:tprocdef):boolean;
|
||||||
function parse_proc_dec(isclassmethod:boolean;astruct:tabstractrecorddef):tprocdef;
|
function parse_proc_dec(isclassmethod:boolean;astruct:tabstractrecorddef):tprocdef;
|
||||||
|
procedure parse_proc_dec_finish(pd:tprocdef;isclassmethod:boolean);
|
||||||
|
|
||||||
{ parse a record method declaration (not a (class) constructor/destructor) }
|
{ parse a record method declaration (not a (class) constructor/destructor) }
|
||||||
function parse_record_method_dec(astruct: tabstractrecorddef; is_classdef: boolean): tprocdef;
|
function parse_record_method_dec(astruct: tabstractrecorddef; is_classdef: boolean): tprocdef;
|
||||||
|
@ -892,7 +892,13 @@ uses
|
|||||||
old_block_type:=block_type;
|
old_block_type:=block_type;
|
||||||
block_type:=bt_type;
|
block_type:=bt_type;
|
||||||
|
|
||||||
if not assigned(genericdef.generictokenbuf) then
|
if (
|
||||||
|
(genericdef.typ=procdef) and
|
||||||
|
not assigned(tprocdef(genericdef).genericdecltokenbuf)
|
||||||
|
) or (
|
||||||
|
(genericdef.typ<>procdef) and
|
||||||
|
not assigned(genericdef.generictokenbuf)
|
||||||
|
) then
|
||||||
internalerror(200511171);
|
internalerror(200511171);
|
||||||
hmodule:=find_module_from_symtable(genericdef.owner);
|
hmodule:=find_module_from_symtable(genericdef.owner);
|
||||||
if hmodule=nil then
|
if hmodule=nil then
|
||||||
@ -909,10 +915,25 @@ uses
|
|||||||
else
|
else
|
||||||
recordbuf:=nil;
|
recordbuf:=nil;
|
||||||
replaydepth:=current_scanner.replay_stack_depth;
|
replaydepth:=current_scanner.replay_stack_depth;
|
||||||
|
if genericdef.typ=procdef then
|
||||||
|
begin
|
||||||
|
current_scanner.startreplaytokens(tprocdef(genericdef).genericdecltokenbuf);
|
||||||
|
parse_proc_head(tprocdef(genericdef).struct,tprocdef(genericdef).proctypeoption,false,genericdef,generictypelist,pd);
|
||||||
|
if assigned(pd) then
|
||||||
|
begin
|
||||||
|
if assigned(psym) then
|
||||||
|
pd.procsym:=psym
|
||||||
|
else
|
||||||
|
pd.procsym:=srsym;
|
||||||
|
parse_proc_dec_finish(pd,po_classmethod in tprocdef(genericdef).procoptions);
|
||||||
|
end;
|
||||||
|
result:=pd;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
current_scanner.startreplaytokens(genericdef.generictokenbuf);
|
current_scanner.startreplaytokens(genericdef.generictokenbuf);
|
||||||
hadtypetoken:=false;
|
hadtypetoken:=false;
|
||||||
read_named_type(result,srsym,genericdef,generictypelist,false,hadtypetoken);
|
read_named_type(result,srsym,genericdef,generictypelist,false,hadtypetoken);
|
||||||
current_filepos:=oldcurrent_filepos;
|
|
||||||
ttypesym(srsym).typedef:=result;
|
ttypesym(srsym).typedef:=result;
|
||||||
result.typesym:=srsym;
|
result.typesym:=srsym;
|
||||||
|
|
||||||
@ -920,6 +941,8 @@ uses
|
|||||||
ttypesym(result.typesym).fprettyname:=_prettyname
|
ttypesym(result.typesym).fprettyname:=_prettyname
|
||||||
else
|
else
|
||||||
ttypesym(result.typesym).fprettyname:=prettyname;
|
ttypesym(result.typesym).fprettyname:=prettyname;
|
||||||
|
end;
|
||||||
|
current_filepos:=oldcurrent_filepos;
|
||||||
|
|
||||||
{ Note regarding hint directives:
|
{ Note regarding hint directives:
|
||||||
There is no need to remove the flags for them from the
|
There is no need to remove the flags for them from the
|
||||||
|
Loading…
Reference in New Issue
Block a user