Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[lex.separate][module.unit] move definitions of program and translation unit #7180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion source/intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
9 changes: 7 additions & 2 deletions source/lex.tex
Original file line number Diff line number Diff line change
@@ -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}}
Expand All @@ -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|(}%
Expand Down
8 changes: 8 additions & 0 deletions source/modules.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}.
Expand Down
Loading