December 09, 2020 Gramamr: Missing production rule | ||||
---|---|---|---|---|
| ||||
Can someone state a production rule according to which `public` and `private` can be applied directly to a declaration, e.g. `public void main() { }`. (What I don't mean is `public { }` blocks or `public:`. Maybe I'm missing it, but I couldn't find one. If it is really the case, I'll fix that in the next days. |
December 09, 2020 Re: Gramamr: Missing production rule | ||||
---|---|---|---|---|
| ||||
Posted in reply to Q. Schroll | On Wednesday, 9 December 2020 at 02:02:18 UTC, Q. Schroll wrote:
> Can someone state a production rule according to which `public` and `private` can be applied directly to a declaration, e.g. `public void main() { }`. (What I don't mean is `public { }` blocks or `public:`. Maybe I'm missing it, but I couldn't find one. If it is really the case, I'll fix that in the next days.
DeclDef
AttributeSpecifier
Attribute
VisibilityAttribute
public
DeclarationBlock
DeclDef
Declaration
FuncDeclaration
// void main() {}
The tricky bit is that "DeclarationBlock" can also be a single declaration, without curly braces.
|
Copyright © 1999-2021 by the D Language Foundation