Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-09

Parser bug or what?

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Daniel Gaspary

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

Reply by email

Sven Barth
to Daniel Gaspary
Daniel Gaspary wrote 27 lines
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

Reply by email

Paul Ishenin
to Daniel Gaspary
Daniel Gaspary wrote 6 lines
On Sun, Sep 15, 2013 at 6:37 AM, Sven Barth wrote: > 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. Done: http://bugs.freepascal.org/view.php?id=25029

Fixed in r25493. The fix also helped to find a bug in fpmake.pp which is used to compile a52 package.

Thank you.

Best regards,
Paul Ishenin

Reply by email

Daniel Gaspary
to Paul Ishenin

I cannot update my Environment at the moment, so I will just close the bug.

Thank you, Paul

Paul Ishenin wrote 26 lines
15.09.13, 21:14, Daniel Gaspary wrote: > > On Sun, Sep 15, 2013 at 6:37 AM, Sven Barth > wrote: >> >> 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. > > > Done: http://bugs.freepascal.org/view.php?id=25029 Fixed in r25493. The fix also helped to find a bug in fpmake.pp which is used to compile a52 package. Thank you. Best regards, Paul Ishenin _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email