D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2653 - ConditionalStatement not referenced in rest of grammar
Summary: ConditionalStatement not referenced in rest of grammar
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: x86 All
: P2 normal
Assignee: No Owner
URL: http://www.digitalmars.com/d/2.0/vers...
Keywords: spec
Depends on:
Blocks:
 
Reported: 2009-02-09 08:28 UTC by Jerry Quinn
Modified: 2015-06-09 01:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jerry Quinn 2009-02-09 08:28:35 UTC
Reading the text, I think the intent was to have the following

ConditionalDeclaration:
    Condition CCDeclarationBlock
    Condition CCDeclarationBlock else CCDeclarationBlock
    Condition : Declarations
    ConditionalStatement
Comment 1 Jerry Quinn 2009-02-09 08:48:27 UTC
Looking into this further, dmd doesn't seem to distinguish between using CCDeclarationBlock or NoScopeNonEmptyStatement.  The compiler's approach seems reasonable to me. In that case, the grammar here should just be:

ConditionalDeclaration:
    Condition NoScopeNonEmptyStatement
    Condition NoScopeNonEmptyStatement else NoScopeNonEmptyStatement
    Condition : Declarations
Comment 2 Walter Bright 2012-01-23 00:17:50 UTC
If a conditional is used in module scope, it cannot contain statements. Hence, the existing grammar is correct.