Skip to content

Commit ee676f2

Browse files
committed
[cpp.pre][cpp.module] Consolidate preprocessor grammar in one clause
The grammar around module directives is quite precise and involved, yet spread across two clauses, the preamble and the module directive clauses. This change set consolidates all the grannar for a _module-file_ into the module directive clause, making it easier to grasp all at once. None of these terms are referenced from outside the clause.
1 parent 05e4d8d commit ee676f2

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

source/preprocessor.tex

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,6 @@
1616
module-file
1717
\end{bnf}
1818

19-
\begin{bnf}
20-
\nontermdef{module-file}\br
21-
\opt{pp-global-module-fragment} pp-module \opt{group} \opt{pp-private-module-fragment}
22-
\end{bnf}
23-
24-
\begin{bnf}
25-
\nontermdef{pp-global-module-fragment}\br
26-
\keyword{module} \terminal{;} new-line \opt{group}
27-
\end{bnf}
28-
29-
\begin{bnf}
30-
\nontermdef{pp-private-module-fragment}\br
31-
\keyword{module} \terminal{:} \keyword{private} \terminal{;} new-line \opt{group}
32-
\end{bnf}
33-
3419
\begin{bnf}
3520
\nontermdef{group}\br
3621
group-part\br
@@ -1214,6 +1199,21 @@
12141199
\rSec1[cpp.module]{Module directive}
12151200
\indextext{preprocessing directive!module}%
12161201

1202+
\begin{bnf}
1203+
\nontermdef{module-file}\br
1204+
\opt{pp-global-module-fragment} pp-module \opt{group} \opt{pp-private-module-fragment}
1205+
\end{bnf}
1206+
1207+
\begin{bnf}
1208+
\nontermdef{pp-global-module-fragment}\br
1209+
\keyword{module} \terminal{;} new-line \opt{group}
1210+
\end{bnf}
1211+
1212+
\begin{bnf}
1213+
\nontermdef{pp-private-module-fragment}\br
1214+
\keyword{module} \terminal{:} \keyword{private} \terminal{;} new-line \opt{group}
1215+
\end{bnf}
1216+
12171217
\begin{bnf}
12181218
\nontermdef{pp-module}\br
12191219
\opt{\keyword{export}} \keyword{module} \opt{pp-tokens} \terminal{;} new-line

0 commit comments

Comments
 (0)