December 09, 2020
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
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.