www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 576] New: version.html - ConditionalStatement grammar doesn't make sense

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=576

           Summary: version.html - ConditionalStatement grammar doesn't make
                    sense
           Product: D
           Version: 0.174
          Platform: All
               URL: http://www.digitalmars.com/d/version.html
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: smjg iname.com
OtherBugsDependingO 511
             nThis:


The grammar for ConditionalStatement, i.e. a conditional compilation block
within a function, is defined as follows:

ConditionalStatement:
    Condition Statement
    Condition Statement else Statement

whereas on statement.html, we have

Statement:
    ;
    NonEmptyStatement
    ScopeBlockStatement

This is implying:
(a) that debug, version and static if create a scope, which is contrary to
their design
(b) that a statement of the form

      static if (...);

is valid, contrary to a design principle of D whereby ';' for an empty body of
something is prevented to avoid a common typo.

It should be changed to

ConditionalStatement:
    Condition NoScopeNonEmptyStatement
    Condition NoScopeNonEmptyStatement else NoScopeNonEmptyStatement


-- 
Nov 19 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=576


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla digitalmars.com  2006-12-27 01:56 -------
Fixed DMD 0.178


-- 
Dec 26 2006