Errors in TDPL

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Wed Jun 23 03:19:52 PDT 2010


On Wed, 23 Jun 2010 11:56:12 +0200, Don wrote:

> bearophile wrote:
>> Andrei:
>>>> void main() {
>>>>      goto FOO;
>>>>      FOO:;
>>>> }
>>> Yes. It shouldn't compile. Walter and I agreed that solitary
>>> semicolons are useless (you can always use {} as an empty statement
>>> and that actually makes things clearer to everyone),
>> 
>> I have had to use a LABEL:; in D code, to implement a finite state
>> machine. So I guess I'll have to write it like this: LABEL: {}
>> 
>> Bye,
>> bearophile
> 
> I think the ; is part of the label statement. If not, it should be
> removed entirely.


This does not compile:

    void main()
    {
        goto Lfoo;
    Lfoo:
    }

test.d(5): found '}' instead of statement

It seems to me like it should be valid code, but I'm not sure it's worth 
making it a special case.

-Lars


More information about the Digitalmars-d mailing list