From 72652154693981f7e965914504007fc8e16b1fad Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 8 Nov 1999 14:02:16 +0000 Subject: [PATCH] * problem with "index X"-properties solved * typed constants of class references are now allowed --- compiler/pexpr.pas | 8 ++++++-- compiler/ptconst.pas | 24 +++++++++++++++++++++++- compiler/ptype.pas | 12 +++++++----- compiler/symsym.inc | 10 +++++++++- compiler/symsymh.inc | 8 ++++++-- 5 files changed, 51 insertions(+), 11 deletions(-) diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index c5b742b632..2f1fd0a852 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -644,7 +644,7 @@ unit pexpr; { indexed property } if (ppo_indexed in ppropertysym(sym)^.propoptions) then begin - p2:=genordinalconstnode(ppropertysym(sym)^.index,s32bitdef); + p2:=genordinalconstnode(ppropertysym(sym)^.index,ppropertysym(sym)^.indexdef); paras:=gencallparanode(p2,paras); end; end; @@ -2113,7 +2113,11 @@ _LECKKLAMMER : begin end. { $Log$ - Revision 1.156 1999-11-07 23:21:30 florian + Revision 1.157 1999-11-08 14:02:16 florian + * problem with "index X"-properties solved + * typed constants of class references are now allowed + + Revision 1.156 1999/11/07 23:21:30 florian * previous fix for 517 was imcomplete: there was a problem if the property had only an index diff --git a/compiler/ptconst.pas b/compiler/ptconst.pas index 205d76bda7..b8a4e8f2ba 100644 --- a/compiler/ptconst.pas +++ b/compiler/ptconst.pas @@ -193,6 +193,24 @@ unit ptconst; end; disposetree(p); end; + classrefdef: + begin + p:=comp_expr(true); + do_firstpass(p); + case p^.treetype of + loadvmtn: + begin + if not(pobjectdef(pclassrefdef(p^.resulttype)^.definition)^.is_related( + pobjectdef(pclassrefdef(def)^.definition))) then + Message(cg_e_illegal_expression); + curconstsegment^.concat(new(pai_const_symbol,init(newasmsymbol(pobjectdef( + pclassrefdef(p^.resulttype)^.definition)^.vmt_mangledname)))); + end; + niln: + curconstsegment^.concat(new(pai_const,init_32bit(0))); + else Message(cg_e_illegal_expression); + end; + end; pointerdef: begin p:=comp_expr(true); @@ -745,7 +763,11 @@ unit ptconst; end. { $Log$ - Revision 1.55 1999-11-06 14:34:23 peter + Revision 1.56 1999-11-08 14:02:16 florian + * problem with "index X"-properties solved + * typed constants of class references are now allowed + + Revision 1.55 1999/11/06 14:34:23 peter * truncated log to 20 revs Revision 1.54 1999/10/14 14:57:54 florian diff --git a/compiler/ptype.pas b/compiler/ptype.pas index d9e0914d43..8173eec529 100644 --- a/compiler/ptype.pas +++ b/compiler/ptype.pas @@ -451,11 +451,8 @@ uses is_64bitint(pt^.resulttype) then Message(parser_e_invalid_property_index_value); p^.index:=pt^.value; -{$ifdef INCLUDEOK} + p^.indexdef:=pt^.resulttype; include(p^.propoptions,ppo_indexed); -{$else} - p^.propoptions:=p^.propoptions+[ppo_indexed]; -{$endif} { concat a longint to the para template } new(hp2,init); hp2^.paratyp:=vs_value; @@ -483,6 +480,7 @@ uses p^.writeaccessdef:=ppropertysym(overriden)^.writeaccessdef; p^.readaccessdef:=ppropertysym(overriden)^.readaccessdef; p^.storeddef:=ppropertysym(overriden)^.storeddef; + p^.indexdef:=ppropertysym(overriden)^.indexdef; p^.default:=ppropertysym(overriden)^.default; end else @@ -1600,7 +1598,11 @@ uses end. { $Log$ - Revision 1.6 1999-11-07 23:16:49 florian + Revision 1.7 1999-11-08 14:02:16 florian + * problem with "index X"-properties solved + * typed constants of class references are now allowed + + Revision 1.6 1999/11/07 23:16:49 florian * finally bug 517 solved ... Revision 1.5 1999/10/27 16:04:06 peter diff --git a/compiler/symsym.inc b/compiler/symsym.inc index 62c694c8ed..f71ba25770 100644 --- a/compiler/symsym.inc +++ b/compiler/symsym.inc @@ -578,6 +578,7 @@ writeaccesssym:=nil; storedsym:=nil; storeddef:=nil; + indexdef:=nil; index:=0; default:=0; @@ -644,6 +645,7 @@ readaccessdef:=readdefref; writeaccessdef:=readdefref; storeddef:=readdefref; + indexdef:=readdefref; end; procedure tpropertysym.deref; @@ -662,6 +664,7 @@ resolvedef(readaccessdef); resolvedef(writeaccessdef); resolvedef(storeddef); + resolvedef(indexdef); resolvepropsymlist(readaccesssym); resolvepropsymlist(writeaccesssym); resolvepropsymlist(storedsym); @@ -697,6 +700,7 @@ writedefref(readaccessdef); writedefref(writeaccessdef); writedefref(storeddef); + writedefref(indexdef); current_ppu^.writeentry(ibpropertysym); end; @@ -2139,7 +2143,11 @@ { $Log$ - Revision 1.124 1999-11-06 14:34:27 peter + Revision 1.125 1999-11-08 14:02:17 florian + * problem with "index X"-properties solved + * typed constants of class references are now allowed + + Revision 1.124 1999/11/06 14:34:27 peter * truncated log to 20 revs Revision 1.123 1999/11/05 17:18:03 pierre diff --git a/compiler/symsymh.inc b/compiler/symsymh.inc index 5390c96c87..023340644d 100644 --- a/compiler/symsymh.inc +++ b/compiler/symsymh.inc @@ -202,7 +202,7 @@ propoptions : tpropertyoptions; proptype : pdef; readaccesssym,writeaccesssym,storedsym : ppropsymlist; - readaccessdef,writeaccessdef,storeddef : pdef; + readaccessdef,writeaccessdef,storeddef,indexdef : pdef; index,default : longint; constructor init(const n : string); destructor done;virtual; @@ -328,7 +328,11 @@ { $Log$ - Revision 1.37 1999-11-06 14:34:28 peter + Revision 1.38 1999-11-08 14:02:17 florian + * problem with "index X"-properties solved + * typed constants of class references are now allowed + + Revision 1.37 1999/11/06 14:34:28 peter * truncated log to 20 revs Revision 1.36 1999/10/01 08:02:48 peter