* fix to allow tv like stream registration:

@tmenu.load doesn't work if load had parameters or if load was only
      declared in an anchestor class of tmenu
This commit is contained in:
florian 1998-07-27 21:57:13 +00:00
parent e2ee811d74
commit 4caf39e3ac
2 changed files with 28 additions and 15 deletions

View File

@ -36,7 +36,7 @@ unit pexpr;
function factor(getaddr : boolean) : ptree; function factor(getaddr : boolean) : ptree;
{ the ID token has to be consumed before calling this function } { the ID token has to be consumed before calling this function }
procedure do_member_read(const sym : psym;var p1 : ptree; procedure do_member_read(getaddr : boolean;const sym : psym;var p1 : ptree;
var pd : pdef;var again : boolean); var pd : pdef;var again : boolean);
function get_intconst:longint; function get_intconst:longint;
@ -414,7 +414,7 @@ unit pexpr;
prevafterassn:=afterassignment; prevafterassn:=afterassignment;
afterassignment:=false; afterassignment:=false;
{ want we only determine the address of } { want we only determine the address of }
{ a subroutine } { a subroutine ? }
if not(getaddr) then if not(getaddr) then
begin begin
if token=LKLAMMER then if token=LKLAMMER then
@ -576,7 +576,7 @@ unit pexpr;
{ the ID token has to be consumed before calling this function } { the ID token has to be consumed before calling this function }
procedure do_member_read(const sym : psym;var p1 : ptree; procedure do_member_read(getaddr : boolean;const sym : psym;var p1 : ptree;
var pd : pdef;var again : boolean); var pd : pdef;var again : boolean);
var var
@ -613,7 +613,7 @@ unit pexpr;
procsym: procsym:
begin begin
p1:=genmethodcallnode(pprocsym(sym),srsymtable,p1); p1:=genmethodcallnode(pprocsym(sym),srsymtable,p1);
do_proc_call(false,again,p1,pd); do_proc_call(getaddr,again,p1,pd);
{ now we know the real method e.g. we can check for } { now we know the real method e.g. we can check for }
{ a class method } { a class method }
if isclassref and ((p1^.procdefinition^.options and (poclassmethod or poconstructor))=0) then if isclassref and ((p1^.procdefinition^.options and (poclassmethod or poconstructor))=0) then
@ -822,7 +822,7 @@ unit pexpr;
classh:=classh^.childof; classh:=classh^.childof;
end; end;
consume(ID); consume(ID);
do_member_read(sym,p1,pd,again); do_member_read(false,sym,p1,pd,again);
end; end;
objectdef: objectdef:
begin begin
@ -837,7 +837,7 @@ unit pexpr;
classh:=classh^.childof; classh:=classh^.childof;
end; end;
consume(ID); consume(ID);
do_member_read(sym,p1,pd,again); do_member_read(false,sym,p1,pd,again);
end; end;
pointerdef: pointerdef:
begin begin
@ -949,8 +949,6 @@ unit pexpr;
end; end;
{$endif TEST_FUNCRET} {$endif TEST_FUNCRET}
var var
possible_error : boolean; possible_error : boolean;
@ -1112,7 +1110,7 @@ unit pexpr;
sym:=pvarsym(srsymtable^.search(pattern)); sym:=pvarsym(srsymtable^.search(pattern));
end; end;
consume(ID); consume(ID);
do_member_read(sym,p1,pd,again); do_member_read(false,sym,p1,pd,again);
end end
else else
begin begin
@ -1128,15 +1126,20 @@ unit pexpr;
p1:=genzeronode(typen); p1:=genzeronode(typen);
p1^.resulttype:=pd; p1^.resulttype:=pd;
{
srsymtable:=pobjectdef(pd)^.publicsyms; srsymtable:=pobjectdef(pd)^.publicsyms;
sym:=pvarsym(srsymtable^.search(pattern)); sym:=pvarsym(srsymtable^.search(pattern));
}
{ TP allows also @TMenu.Load if Load is only }
{ defined in an anchestor class }
sym:=pvarsym(search_class_member(pobjectdef(pd),pattern));
if not(getaddr) and if not(getaddr) and
((sym^.properties and sp_static)=0) then ((sym^.properties and sp_static)=0) then
Message(sym_e_only_static_in_static) Message(sym_e_only_static_in_static)
else else
begin begin
consume(ID); consume(ID);
do_member_read(sym,p1,pd,again); do_member_read(getaddr,sym,p1,pd,again);
end; end;
end end
end end
@ -1298,7 +1301,7 @@ unit pexpr;
end; end;
consume(ID); consume(ID);
do_member_read(sym,p1,pd,again); do_member_read(false,sym,p1,pd,again);
if (p1^.treetype<>calln) or if (p1^.treetype<>calln) or
(assigned(p1^.procdefinition) and (assigned(p1^.procdefinition) and
((p1^.procdefinition^.options and poconstructor)=0)) then ((p1^.procdefinition^.options and poconstructor)=0)) then
@ -1355,7 +1358,7 @@ unit pexpr;
p1^.resulttype:=classh; p1^.resulttype:=classh;
pd:=p1^.resulttype; pd:=p1^.resulttype;
consume(ID); consume(ID);
do_member_read(sym,p1,pd,again); do_member_read(false,sym,p1,pd,again);
break; break;
end; end;
classh:=classh^.childof; classh:=classh^.childof;
@ -1785,7 +1788,12 @@ unit pexpr;
end. end.
{ {
$Log$ $Log$
Revision 1.28 1998-07-14 21:46:51 peter Revision 1.29 1998-07-27 21:57:13 florian
* fix to allow tv like stream registration:
@tmenu.load doesn't work if load had parameters or if load was only
declared in an anchestor class of tmenu
Revision 1.28 1998/07/14 21:46:51 peter
* updated messages file * updated messages file
Revision 1.27 1998/06/25 14:04:23 peter Revision 1.27 1998/06/25 14:04:23 peter

View File

@ -772,7 +772,7 @@ unit pstatmnt;
begin begin
{ Constructors can take parameters.} { Constructors can take parameters.}
p2^.resulttype:=ppointerdef(pd)^.definition; p2^.resulttype:=ppointerdef(pd)^.definition;
do_member_read(sym,p2,pd,again); do_member_read(false,sym,p2,pd,again);
end end
else else
{ destructors can't.} { destructors can't.}
@ -1168,7 +1168,12 @@ unit pstatmnt;
end. end.
{ {
$Log$ $Log$
Revision 1.25 1998-07-14 21:46:53 peter Revision 1.26 1998-07-27 21:57:14 florian
* fix to allow tv like stream registration:
@tmenu.load doesn't work if load had parameters or if load was only
declared in an anchestor class of tmenu
Revision 1.25 1998/07/14 21:46:53 peter
* updated messages file * updated messages file
Revision 1.24 1998/07/10 10:48:42 peter Revision 1.24 1998/07/10 10:48:42 peter