Skip to content

Commit 324f564

Browse files
authored
[lex.pptoken] Reorder paragraphs to define terms before they are used (#7346)
First move p1 below p2, so that we do not refer to preprocessing tokens before they are defined. Then move p4 up, as it is splitting some unrelated examples, neither of which use its contents.
1 parent ac5b250 commit 324f564

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

source/lex.tex

+17-16
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,6 @@
509509
\textnormal{each non-whitespace character that cannot be one of the above}
510510
\end{bnf}
511511

512-
\pnum
513-
Each preprocessing token that is converted to a token\iref{lex.token}
514-
shall have the lexical form of a keyword, an identifier, a literal,
515-
or an operator or punctuator.
516-
517512
\pnum
518513
A preprocessing token is the minimal lexical element of the language in translation
519514
phases 3 through 6.
@@ -548,6 +543,22 @@
548543
between the quotation characters in a character literal or
549544
string literal.
550545

546+
\pnum
547+
Each preprocessing token that is converted to a token\iref{lex.token}
548+
shall have the lexical form of a keyword, an identifier, a literal,
549+
or an operator or punctuator.
550+
551+
\pnum
552+
The \grammarterm{import-keyword} is produced
553+
by processing an \keyword{import} directive\iref{cpp.import},
554+
the \grammarterm{module-keyword} is produced
555+
by preprocessing a \keyword{module} directive\iref{cpp.module}, and
556+
the \grammarterm{export-keyword} is produced
557+
by preprocessing either of the previous two directives.
558+
\begin{note}
559+
None has any observable spelling.
560+
\end{note}
561+
551562
\pnum
552563
If the input stream has been parsed into preprocessing tokens up to a
553564
given character:
@@ -587,24 +598,14 @@
587598
\end{itemize}
588599
\end{itemize}
589600

601+
\pnum
590602
\begin{example}
591603
\begin{codeblock}
592604
#define R "x"
593605
const char* s = R"y"; // ill-formed raw string, not \tcode{"x" "y"}
594606
\end{codeblock}
595607
\end{example}
596608

597-
\pnum
598-
The \grammarterm{import-keyword} is produced
599-
by preprocessing an \keyword{import} directive\iref{cpp.import},
600-
the \grammarterm{module-keyword} is produced
601-
by preprocessing a \keyword{module} directive\iref{cpp.module}, and
602-
the \grammarterm{export-keyword} is produced
603-
by preprocessing either of the previous two directives.
604-
\begin{note}
605-
None has any observable spelling.
606-
\end{note}
607-
608609
\pnum
609610
\begin{example}
610611
The program fragment \tcode{0xe+foo} is parsed as a

0 commit comments

Comments
 (0)