mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 19:49:22 +02:00
* symtable.pas:
+ search_management_operator function to find Tprocdef for selected management operator in record definition tokens.pas: + new constants: first_managment_operator and last_managment_operator used in search_management_operator git-svn-id: trunk@35444 -
This commit is contained in:
parent
9441fb3968
commit
25db29d0a6
@ -346,6 +346,7 @@ interface
|
|||||||
function search_struct_member_no_helper(pd : tabstractrecorddef;const s : string):tsym;
|
function search_struct_member_no_helper(pd : tabstractrecorddef;const s : string):tsym;
|
||||||
function search_assignment_operator(from_def,to_def:Tdef;explicit:boolean):Tprocdef;
|
function search_assignment_operator(from_def,to_def:Tdef;explicit:boolean):Tprocdef;
|
||||||
function search_enumerator_operator(from_def,to_def:Tdef):Tprocdef;
|
function search_enumerator_operator(from_def,to_def:Tdef):Tprocdef;
|
||||||
|
function search_management_operator(mop:tmanagementoperator;pd:Tdef):Tprocdef;
|
||||||
{ searches for the helper definition that's currently active for pd }
|
{ searches for the helper definition that's currently active for pd }
|
||||||
function search_last_objectpascal_helper(pd : tdef;contextclassh : tabstractrecorddef;out odef : tobjectdef):boolean;
|
function search_last_objectpascal_helper(pd : tdef;contextclassh : tabstractrecorddef;out odef : tobjectdef):boolean;
|
||||||
{ searches whether the symbol s is available in the currently active }
|
{ searches whether the symbol s is available in the currently active }
|
||||||
@ -436,6 +437,14 @@ interface
|
|||||||
{ _OP_INC } 'inc',
|
{ _OP_INC } 'inc',
|
||||||
{ _OP_DEC } 'dec');
|
{ _OP_DEC } 'dec');
|
||||||
|
|
||||||
|
managementoperator2tok:array[tmanagementoperator] of ttoken = (
|
||||||
|
{ mop_none } NOTOKEN,
|
||||||
|
{ mop_initialize } _OP_INITIALIZE,
|
||||||
|
{ mop_finalize } _OP_FINALIZE,
|
||||||
|
{ mop_addref } _OP_ADDREF,
|
||||||
|
{ mop_copy } _OP_COPY
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -3738,6 +3747,31 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function search_management_operator(mop:tmanagementoperator;pd:Tdef):Tprocdef;
|
||||||
|
var
|
||||||
|
sym : Tprocsym;
|
||||||
|
hashedid : THashedIDString;
|
||||||
|
optoken: ttoken;
|
||||||
|
begin
|
||||||
|
optoken := managementoperator2tok[mop];
|
||||||
|
if (optoken<first_managment_operator) or
|
||||||
|
(optoken>last_managment_operator) then
|
||||||
|
internalerror(201602280);
|
||||||
|
hashedid.id:=overloaded_names[optoken];
|
||||||
|
if not (pd.typ in [recorddef]) then
|
||||||
|
internalerror(201602281);
|
||||||
|
sym:=Tprocsym(tabstractrecorddef(pd).symtable.FindWithHash(hashedid));
|
||||||
|
if sym<>nil then
|
||||||
|
begin
|
||||||
|
if sym.typ<>procsym then
|
||||||
|
internalerror(201602282);
|
||||||
|
result:=sym.find_procdef_bytype(potype_operator);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
result:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function search_system_type(const s: TIDString): ttypesym;
|
function search_system_type(const s: TIDString): ttypesym;
|
||||||
var
|
var
|
||||||
sym : tsym;
|
sym : tsym;
|
||||||
|
@ -334,6 +334,8 @@ const
|
|||||||
first_overloaded = succ(NOTOKEN);
|
first_overloaded = succ(NOTOKEN);
|
||||||
last_overloaded = _OP_DEC;
|
last_overloaded = _OP_DEC;
|
||||||
last_operator = _GENERICSPECIALTOKEN;
|
last_operator = _GENERICSPECIALTOKEN;
|
||||||
|
first_managment_operator = _OP_INITIALIZE;
|
||||||
|
last_managment_operator = _OP_COPY;
|
||||||
|
|
||||||
highest_precedence = oppower;
|
highest_precedence = oppower;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user