diff --git a/source/basic.tex b/source/basic.tex index 9524265f81..69e81e32ef 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -2648,23 +2648,10 @@ only namespace names are considered.% \indextext{lookup!name|)}% -\rSec1[basic.link]{Program and linkage}% +\rSec1[basic.link]{Linkage}% \indextext{linkage|(} \pnum -\indextext{program}% -A \defn{program} consists of one or more translation units\iref{lex.separate} -linked together. A translation unit consists -of a sequence of declarations. - -\begin{bnf} -\nontermdef{translation-unit}\br - \opt{declaration-seq}\br - \opt{global-module-fragment} module-declaration \opt{declaration-seq} \opt{private-module-fragment} -\end{bnf} - -\pnum -\indextext{translation unit}% A name can have \defnadj{external}{linkage}, \defnadj{module}{linkage}, diff --git a/source/intro.tex b/source/intro.tex index 4f2984457d..71ff1d60c4 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -476,7 +476,7 @@ \begin{defnote} Only one definition for such a function is in effect for the duration of the program's execution, as the result of creating the program\iref{lex.phases} and resolving the -definitions of all translation units\iref{basic.link}. +definitions of all translation units\iref{module.unit}. \end{defnote} \definition{required behavior}{defns.required.behavior} diff --git a/source/lex.tex b/source/lex.tex index d58678c2d9..524bc9d845 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -1,7 +1,7 @@ %!TEX root = std.tex -\rSec0[lex]{Lexical conventions} +\rSec0[lex]{Programs} -\gramSec[gram.lex]{Lexical conventions} +\gramSec[gram.lex]{Programs} \indextext{lexical conventions|see{conventions, lexical}} \indextext{translation!separate|see{compilation, separate}} @@ -24,6 +24,11 @@ \rSec1[lex.separate]{Separate translation} +\pnum +\indextext{program}% +A \defn{program} consists of one or more translation units\iref{lex.phases,module.unit} +linked together. + \pnum \indextext{conventions!lexical|(}% \indextext{compilation!separate|(}% diff --git a/source/modules.tex b/source/modules.tex index 2ed009a3b6..9298ba4dee 100644 --- a/source/modules.tex +++ b/source/modules.tex @@ -6,6 +6,10 @@ \rSec1[module.unit]{Module units and purviews} \begin{bnf} +\nontermdef{translation-unit}\br + \opt{declaration-seq}\br + \opt{global-module-fragment} module-declaration \opt{declaration-seq} \opt{private-module-fragment} + \nontermdef{module-declaration}\br \opt{export-keyword} module-keyword module-name \opt{module-partition} \opt{attribute-specifier-seq} \terminal{;} \end{bnf} @@ -26,6 +30,10 @@ module-name-qualifier identifier \terminal{.} \end{bnf} +\pnum +\indextext{translation unit}% +A translation unit consists of a sequence of declarations. + \pnum A \defn{module unit} is a translation unit that contains a \grammarterm{module-declaration}.