[fpc-devel] "helper" feature finished

Sven Barth pascaldragon at googlemail.com
Fri Apr 8 08:58:27 CEST 2011


Am 06.04.2011 13:35, schrieb Florian Klaempfl:
> Am 05.04.2011 17:34, schrieb Sven Barth:
>> Am 05.04.2011 17:06, schrieb Florian Klaempfl:
>>> Am 05.04.2011 04:27, schrieb Paul Ishenin:
>>>>
>>>> I think your branch should be reviewed either by Florian
>>>
>>> I did a quick review and found nothing important, only a few remarks:
>>> - current_syssym: is it really needed? Can't the type checking be done
>>> during the type check pass? If it's needed, it should be reset to 0
>>> somewhere during parser initialization because in case of a fatal error
>>> when the compiler is compiled into an ide, at the next start
>>> current_syssym would have a wrong value.
>>
>> The problem is that basically all references to class helpers are
>> forbidden except inside of SizeOf and TypeInfo (and BitSizeOf). Thus
>> when one of those symbols is encountered the checks against the use of a
>> class helper type reference are already "active". So the only way out I
>> have found was the introduction of that current_syssym variable to check
>> whether I'm currently inside one of those three functions. If you have
>> an idea how to solve this with by using the type check pass I'll be glad
>> to do so.
>
>
> Just let me ask different: what code compiles, if the check is not here?
> The expressions accepting a type node but not a class helper should be
> easily fixable.

I've now looked at that again and I still don't see a possibility to 
"drop" current_syssym again (of course I don't know whether I've looked 
at the correct locations and understood everything correctly...).

You basically suggest to extend ttypenode.typecheck_pass to check for a 
class helper, correct? If so then the problem is that I can't check 
whether I'm inside one of the three allowed syssyms as no node is 
generated for them (yet). Also typecheck_pass is already called inside 
comp_expr (by postfixoperators) so I can't even say to simply not do 
do_typecheckpass_changed.

So if I haven't misunderstood the concept somewhere (point 1) or you 
haven't got a better/correct solution (point 2) then I'm afraid that 
current_syssym needs to stay (of course with a proper initialization ^^).

Regards,
Sven



More information about the fpc-devel mailing list