[Issue 327] Compiler accepts ';' by itself as a statement

Stewart Gordon smjg_1998 at yahoo.com
Sun Nov 19 14:59:44 PST 2006


d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=327
> 
> 
> bugzilla at digitalmars.com changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|REOPENED                    |RESOLVED
>          Resolution|                            |INVALID
> 
> ------- Comment #6 from bugzilla at digitalmars.com  2006-11-19 14:32 -------
> Both DebugStatement and VersionStatement allow a ';' as a statement, as both
> have Statement in the grammar, and Statement includes ';'. In other words, this
> is not a bug as the spec matches the implementation. If you want to change it,
> it should be marked as an enhancement request, not a bug.

Regardless of the obviousness that leaving it specified this way was a 
slip-up?

> As to why allow empty statements, 1) such are common in C like languages and
> are expected to be there

Expected by whom?

> and 2) they are 'boundary' or 'degenerate' cases and
> can be handy to have as markers, placeholders, or to just make it easier for
> programs that generate source code as output. They don't hurt anything.

Hmm....

Stewart.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- 
PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y
------END GEEK CODE BLOCK------

My e-mail is valid but not my primary mailbox.  Please keep replies on 
the 'group where everyone may benefit.



More information about the Digitalmars-d-bugs mailing list