[fpc-devel] [] property overloads

Ryan Joseph genericptr at gmail.com
Tue Jul 2 15:32:14 CEST 2019



> On Jul 2, 2019, at 3:20 AM, Ondrej Pokorny <lazarus at kluug.net> wrote:
> 
> This code is never executed for an array property. The "[" for an array property is processed directly in handle_propertysym:
> 
>     procedure handle_propertysym(propsym : tpropertysym;st : TSymtable;var p1 : tnode);
>       var
>          paras : tnode;
>          p2    : tnode;
>          membercall : boolean;
>          callflags  : tcallnodeflags;
>          propaccesslist : tpropaccesslist;
>          sym: tsym;
>       begin
>          { property parameters? read them only if the property really }
>          { has parameters                                             }
>          paras:=nil;
>          if (ppo_hasparameters in propsym.propoptions) then
>            begin
>              if try_to_consume(_LECKKLAMMER) then
>                begin
>                  paras:=parse_paras(false,false,_RECKKLAMMER);
>                  consume(_RECKKLAMMER);
>                end;
>            end;
> 

btw, I did need to change this for my patch to work. What happens now is that [] is parsed before handle_propertysym so the parameters can be evaluated and a proper property sym chosen and then passed to handle_propertysym. It’s probably going to be weeks or months before they can apply the patch anyways so I don’t want to make it more complicated than it has to be by adding more stuff. If anything it would be best to fix some of these weird bugs that we found with properties (did anyone file a bug report yet?).

Regards,
	Ryan Joseph



More information about the fpc-devel mailing list