From 402ae4780633ae5d26ea71077636121872d4314c Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Thu, 31 Jul 2025 08:53:59 -0400 Subject: [PATCH] [pre] No names in the preprocessor The term "name" applies specifically to entities in phase 7 of translation. Macros have macro names, headers are parsed as *header-name*s, etc. --- source/preprocessor.tex | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 38c595333c..6bf00a0a6f 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -500,7 +500,7 @@ directives, and the \tcode{defined} conditional inclusion operator, shall treat \xname{has_include}, \xname{has_embed}, and \xname{has_cpp_attribute} -as if they were the names of defined macros. +as if they were the macro names of defined macros. The identifiers \xname{has_include}, \xname{has_embed}, and \xname{has_cpp_attribute} shall not appear in any context not mentioned in this subclause. @@ -618,7 +618,7 @@ Each directive's condition is checked in order. If it evaluates to false (zero), the group that it controls is skipped: -directives are processed only through the name that determines +directives are processed only through the directive name that determines the directive in order to keep track of the level of nested conditionals; the rest of the directives' preprocessing tokens are ignored, @@ -1045,7 +1045,7 @@ \end{note} \begin{example} If the directive matches the second form, the whole directive is replaced. -If the directive matches the first form, everything after the name is replaced. +If the directive matches the first form, everything after the \grammarterm{header-name} is replaced. \begin{codeblock} #define EMPTY #define X myfile @@ -1532,11 +1532,11 @@ \pnum \indextext{unit!translation}% A translation unit shall not \tcode{\#define} or \tcode{\#undef} -names lexically identical +macro names lexically identical to keywords, to the identifiers listed in \tref{lex.name.special}, or to the \grammarterm{attribute-token}{s} described in~\ref{dcl.attr}, -except that the names \tcode{likely} and \tcode{unlikely} may be +except that the macro names \tcode{likely} and \tcode{unlikely} may be defined as function-like macros. \pnum @@ -1571,7 +1571,7 @@ An alternative token\iref{lex.digraph} is not an identifier, even when its spelling consists entirely of letters and underscores. Therefore it is not possible to define a macro -whose name is the same as that of an alternative token. +whose macro name is the same as that of an alternative token. \end{footnote} The replacement list is then rescanned for more macro names as specified below. @@ -2022,12 +2022,12 @@ \end{example} \pnum -If the name of the macro being replaced is found during this scan of +If the macro name of the macro being replaced is found during this scan of the replacement list (not including the rest of the source file's preprocessing tokens), it is not replaced. Furthermore, -if any nested replacements encounter the name of the macro being replaced, +if any nested replacements encounter the macro name of the macro being replaced, it is not replaced. These nonreplaced macro name preprocessing tokens are no longer available for further replacement even if they are later (re)examined in contexts @@ -2191,7 +2191,7 @@ replace the value of this macro with a greater value. \end{note} -\item The names listed in \tref{cpp.predefined.ft}.\\ +\item The macro names listed in \tref{cpp.predefined.ft}.\\ The macros defined in \tref{cpp.predefined.ft} shall be defined to the corresponding integer literal. \begin{note}