From 391c5a3467f5ac9a1e2b3aa9bd7f50792a80f159 Mon Sep 17 00:00:00 2001
From: Mark Wooding <mdw@distorted.org.uk>
Date: Sun, 10 Jan 2016 13:51:04 +0000
Subject: [PATCH] doc/syntax.tex: Refactor the <class-definition> syntax.

  * Attach the semicolon terminators to the individual <...-item>
    syntaxes rather than including them in <class-item>.

  * Conversely, pull the property sets out of the individual items and
    into the top-level syntax, on the grounds that all class items have
    property sets as a fundamental part of the high-level syntax.
---
 doc/syntax.tex   | 18 ++++++++++--------
 src/sod-module.5 | 22 +++++++++-------------
 2 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/doc/syntax.tex b/doc/syntax.tex
index 2059caf..3727013 100644
--- a/doc/syntax.tex
+++ b/doc/syntax.tex
@@ -546,8 +546,10 @@ class Sub : Super {
   "class" <identifier> ":" <list>$[\mbox{@<identifier>}]$
   "{" @<properties-class-item>^* "}"
 
-<class-item> ::= <slot-item> ";"
-\alt <initializer-item> ";"
+<properties-class-item> ::= @[<properties>@] <class-item>
+
+<class-item> ::= <slot-item>
+\alt <initializer-item>
 \alt <message-item>
 \alt <method-item>
 \end{grammar}
@@ -590,7 +592,6 @@ These items are discussed on the following sections.
 
 \begin{grammar}
 <slot-item> ::=
-  @[<properties>@]
   @<declaration-specifier>^+ <list>$[\mbox{@<init-declarator>}]$ ";"
 
 <init-declarator> ::= <simple-declarator> @["=" <initializer>@]
@@ -626,7 +627,7 @@ class Example : Super {
 \subsubsection{Initializer items} \label{sec:syntax.class.init}
 
 \begin{grammar}
-<initializer-item> ::= @["class"@] <list>$[\mbox{@<slot-initializer>}]$
+<initializer-item> ::= @["class"@] <list>$[\mbox{@<slot-initializer>}]$ ";"
 
 <slot-initializer> ::= <dotted-name> "=" <initializer>
 
@@ -655,16 +656,17 @@ The initializer has one of two forms.
 
 \begin{grammar}
 <message-item> ::=
-  @[<properties>@]
-  @<declaration-specifier>^+ <simple-declarator> @[<method-body>@]
+  @<declaration-specifier>^+
+  <keyword-declarator>$[\mbox{@<identifier>}]$
+  @[<method-body>@]
 \end{grammar}
 
 \subsubsection{Method items} \label{sec:syntax.class.method}
 
 \begin{grammar}
 <method-item> ::=
-  @[<properties>@]
-  @<declaration-specifier>^+ <declarator>$[\mbox{@<dotted-name>}]$
+  @<declaration-specifier>^+
+  <keyword-declarator>$[\mbox{@<dotted-name>}]$
   <method-body>
 
 <method-body> ::= "{" <c-fragment> "}" | "extern" ";"
diff --git a/src/sod-module.5 b/src/sod-module.5
index 5de8432..2a1123f 100644
--- a/src/sod-module.5
+++ b/src/sod-module.5
@@ -520,9 +520,14 @@ class-definition
 .IR list [ identifier ]
 .<
 .B {
-.IR class-item \**
+.IR properties-class-item \**
 .B }
 .br
+.I properties-class-item
+::=
+.RI [ properties ]
+.I class-item
+.br
 .I class-item
 ::=
 .I slot-item
@@ -536,7 +541,6 @@ class-definition
 .I slot-item
 ::=
 .<
-.RI [ properties ]
 .IR declaration-specifier \*+
 .IR list [ init-declarator ]
 .B ;
@@ -549,7 +553,6 @@ class-definition
 .br
 .I initializer-item
 ::=
-.RI [ properties ]
 .RB [ class ]
 .IR list [ slot-initializer ]
 .B ;
@@ -570,19 +573,16 @@ class-definition
 .br
 .I message-item
 ::=
-.RI [ properties ]
 .<
 .IR declaration-specifier \*+
 .I simple-declarator
-.<
 .RI [ method-body ]
 .br
 .I method-item
-.RI [ properties ]
+::=
 .<
 .IR declaration-specifier \*+
-.I dotted-declarator
-.<
+.IR declarator [ dotted-name ]
 .I method-body
 .br
 .I method-body
@@ -818,11 +818,7 @@ and one of the following, up to reordering.
 .I identifier
 .B .\&
 .I identifier
-.br
-.I dotted-declarator
-::=
-.IR declarator [ dotted-name ]
-
+.
 .\"--------------------------------------------------------------------------
 .SH SEE ALSO
 .BR sod (1),
-- 
2.11.0

