Is this a bug or a feature?

Ellery Newcomer ellery-newcomer at utulsa.edu
Thu Jan 7 10:58:15 PST 2010


On 01/07/2010 07:04 AM, Daniel Murphy wrote:
> The following code compiles under dmd v2.037, no closing brace required.
>
> ---------------
> import std.stdio;
>
> void main()
> {
> 	while(true)
> 		writeln("Bug!");
> ---------------
>
> Bug, or feature for the extremely lazy?

in parse.c, Parser::parseStatement, around line 3533, there be

  case TOKlcurly:
         {
             nextToken();
             Statements *statements = new Statements();
             while (token.value != TOKrcurly && token.value != TOKeof)
             {
                 statements->push(parseStatement(PSsemi | PScurlyscope));
             }
             .....

don't know why the TOKeof is there, but that's what's causing the issue.



More information about the Digitalmars-d mailing list