Skip to content

Commit 86d979a

Browse files
committed
[lex.separate][module.unit] move definitions of program and translation unit
The definition of program at the top of [basic.link] should move to the front of [lex.separate] so that it is defined before its first usage, and also clarifies that the phases of translation produce. Similarly, move the definition of the grammar production translation-unit to the top of the first clause to actually use it, [module.unit]. Finally, retitle [basic.link] as just Linkage, rather than prgrams and linkage.
1 parent eb9872a commit 86d979a

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

source/basic.tex

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,23 +2648,10 @@
26482648
only namespace names are considered.%
26492649
\indextext{lookup!name|)}%
26502650

2651-
\rSec1[basic.link]{Program and linkage}%
2651+
\rSec1[basic.link]{Linkage}%
26522652
\indextext{linkage|(}
26532653

26542654
\pnum
2655-
\indextext{program}%
2656-
A \defn{program} consists of one or more translation units\iref{lex.separate}
2657-
linked together. A translation unit consists
2658-
of a sequence of declarations.
2659-
2660-
\begin{bnf}
2661-
\nontermdef{translation-unit}\br
2662-
\opt{declaration-seq}\br
2663-
\opt{global-module-fragment} module-declaration \opt{declaration-seq} \opt{private-module-fragment}
2664-
\end{bnf}
2665-
2666-
\pnum
2667-
\indextext{translation unit}%
26682655
A name can have
26692656
\defnadj{external}{linkage},
26702657
\defnadj{module}{linkage},

source/intro.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@
476476
\begin{defnote}
477477
Only one definition for such a function is in effect for the duration of the program's
478478
execution, as the result of creating the program\iref{lex.phases} and resolving the
479-
definitions of all translation units\iref{basic.link}.
479+
definitions of all translation units\iref{module.unit}.
480480
\end{defnote}
481481

482482
\definition{required behavior}{defns.required.behavior}

source/lex.tex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%!TEX root = std.tex
22
\rSec0[lex]{Lexical conventions}
33

4-
\gramSec[gram.lex]{Lexical conventions}
4+
\gramSec[gram.lex]{Programs}
55

66
\indextext{lexical conventions|see{conventions, lexical}}
77
\indextext{translation!separate|see{compilation, separate}}
@@ -24,6 +24,11 @@
2424

2525
\rSec1[lex.separate]{Separate translation}
2626

27+
\pnum
28+
\indextext{program}%
29+
A \defn{program} consists of one or more translation units\iref{lex.phases,module.unit}
30+
linked together.
31+
2732
\pnum
2833
\indextext{conventions!lexical|(}%
2934
\indextext{compilation!separate|(}%

source/modules.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
\rSec1[module.unit]{Module units and purviews}
77

88
\begin{bnf}
9+
\nontermdef{translation-unit}\br
10+
\opt{declaration-seq}\br
11+
\opt{global-module-fragment} module-declaration \opt{declaration-seq} \opt{private-module-fragment}
12+
913
\nontermdef{module-declaration}\br
1014
\opt{export-keyword} module-keyword module-name \opt{module-partition} \opt{attribute-specifier-seq} \terminal{;}
1115
\end{bnf}
@@ -26,6 +30,10 @@
2630
module-name-qualifier identifier \terminal{.}
2731
\end{bnf}
2832

33+
\pnum
34+
\indextext{translation unit}%
35+
A translation unit consists of a sequence of declarations.
36+
2937
\pnum
3038
A \defn{module unit} is a translation unit that contains
3139
a \grammarterm{module-declaration}.

0 commit comments

Comments
 (0)