Bug 2653 – ConditionalStatement not referenced in rest of grammar
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-02-09T08:28:00Z
Last change time
2015-06-09T01:21:00Z
Keywords
spec
Assigned to
nobody
Creator
jlquinn
Comments
Comment #0 by jlquinn — 2009-02-09T08:28:35Z
Reading the text, I think the intent was to have the following
ConditionalDeclaration:
Condition CCDeclarationBlock
Condition CCDeclarationBlock else CCDeclarationBlock
Condition : Declarations
ConditionalStatement
Comment #1 by jlquinn — 2009-02-09T08:48:27Z
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 by bugzilla — 2012-01-23T00:17:50Z
If a conditional is used in module scope, it cannot contain statements. Hence, the existing grammar is correct.