[fpc-pascal] fpc procedure modifier []
Mattias Gaertner
nc-gaertnma at netcologne.de
Thu Nov 16 15:10:08 CET 2017
On Thu, 16 Nov 2017 14:12:18 +0100
Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
>[...]
> So, how will FPC distinguish the two []?
>
>
> The only idea I have is to check whether the first identifier is a
> attribute and if not handle it as a modifier (or if a comma is following
> the first identifier).
pparser can't do that.
And I fear that this heuristic will lead to confusing error messages. I
hope there is a better way.
Delphi does not support it. It thinks it is an undefined attribute. So
IMO FPC's [] modifier should be disabled in mode delphi+delphiunicode.
So the problem will only happen in mode objfpc or when the user
enable the modeswitch prefixedattributes.
Maybe pparser can use a heuristic. What is the syntax and keywords of
fpc's [] modifier?
If it is correct that FPC's modifier was never documented and is
hardly used, perhaps a $modeswitch procmodifierbrackets can be
added?
Mattias
More information about the fpc-pascal
mailing list