[fpc-pascal] Parser bug or what?

Sven Barth pascaldragon at googlemail.com
Sun Sep 15 11:37:40 CEST 2013


On 15.09.2013 03:55, Daniel Gaspary wrote:
> Can anybody tell me whether I stepped on a bug  or I am just
> forgetting some Set / Enum property?
>
> I made a Set to iterate with For..in, but I accidentally used a Dot
> instead of a Comma between the elements.
>
> The result was that the For "sees" only the item(s) after the Dot as the Example
>
> What's Happening in the example ??
>
> program Project1;
> type
>      TMyEnum = (me1, me2, me3);
>      TMyEnumSet = set of TMyEnum;
> var
>     e: TMyEnum;
> begin
>       for e in [me1 . me2] do  //It's a dot, not a comma
>           WriteLn(e);
> end.
>
> It works with other combinations, like:
>
> [me1 . me2. me3.]  // DOT DOT DOT
> [me1 , me2. me3.]  // COMMA DOT DOT
>
> My FPC version: 2.7.1 [2013/03/26] for x86_64

Seems to be a bug related to scoped enums (in your example that would be 
"TMyEnum.me1"). Please report it as a bug with the example mentioned 
above as a file.

Regards,
Sven




More information about the fpc-pascal mailing list