if (int x=..) but no while(int x=..) ?

Lionello Lunesu lio at remove.lunesu.com
Fri Mar 17 00:02:24 PST 2006


> The grammar for D does not allow a
>
> "Declarator = Expression"
>
> inside the braces of a while statement. The "IfCondition" rule does allow 
> this
> for the if statements, however. Now, can the grammar be modified to accept 
> the
> "Declarator = Expression" rule? Yes, I just modified my grammar and it 
> works
> without conflicts. As for any deeper questions about the
> validity/usability/maintainability of this...well that is for Walter to 
> decide,
> I guess.

Nice test, thanks. So with no grammatical conflicts and the added symmetry, 
it should be easy to get Walter's backing on this : )

Lionello. 





More information about the Digitalmars-d mailing list