Skip to content
Open
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
22 changes: 15 additions & 7 deletions source/lex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -553,13 +553,21 @@
\pnum
A preprocessing token is the minimal lexical element of the language in translation
phases 3 through 5.
The categories of preprocessing token are: header names,
placeholder tokens produced by preprocessing \tcode{import} and \tcode{module} directives
(\grammarterm{import-keyword}, \grammarterm{module-keyword}, and \grammarterm{export-keyword}),
identifiers, preprocessing numbers, character literals (including user-defined character
literals), string literals (including user-defined string literals), preprocessing
operators and punctuators, and single non-whitespace characters that do not lexically
match the other preprocessing token categories.
The categories of preprocessing token are:
\begin{itemize}
\item header names;
\item placeholder tokens produced by preprocessing \tcode{import}
and \tcode{module} directives
(\grammarterm{import-keyword}, \grammarterm{module-keyword},
and \grammarterm{export-keyword});
\item identifiers;
\item preprocessing numbers;
\item character literals (including user-defined character literals);
\item string literals (including user-defined string literals);
\item preprocessing operators and punctuators;
\item single non-whitespace characters that do not lexically
match the other preprocessing token categories.
\end{itemize}
Comment on lines +557 to +570

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this would be cleaner if you used the \item-on-separate-line form here:

Suggested change
\begin{itemize}
\item header names;
\item placeholder tokens produced by preprocessing \tcode{import}
and \tcode{module} directives
(\grammarterm{import-keyword}, \grammarterm{module-keyword},
and \grammarterm{export-keyword});
\item identifiers;
\item preprocessing numbers;
\item character literals (including user-defined character literals);
\item string literals (including user-defined string literals);
\item preprocessing operators and punctuators;
\item single non-whitespace characters that do not lexically
match the other preprocessing token categories.
\end{itemize}
\begin{itemize}
\item
header names;
\item
placeholder tokens produced by preprocessing \tcode{import} and \tcode{module} directives
(\grammarterm{import-keyword}, \grammarterm{module-keyword}, and \grammarterm{export-keyword});
\item
identifiers;
\item
preprocessing numbers;
\item
character literals
(including user-defined character literals);
\item
string literals
(including user-defined string literals);
\item
preprocessing operators and punctuators;
\item
single non-whitespace characters
that do not lexically match the other preprocessing token categories.
\end{itemize}

It's just more maintainable that way and the semantic line breaks come out cleaner. Perhaps we could also add some forward references here. We mention "string literals" which are described in subsequent subclause [lex.string], but don't provide a forward reference. That would make each item longer as well and justify having multiple lines for more \items.

If a \unicode{0027}{apostrophe}, a \unicode{0022}{quotation mark},
or any character not in the basic character set
matches the last category, the program is ill-formed.
Expand Down
Loading