From 8322e9503595f6d37fa5c7bff68860641d410010 Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Thu, 24 Jul 2025 09:02:50 -0400 Subject: [PATCH] [lex.phases] Move dropping whitespace to end of phase 4 Phase 7 deals only with tokens, not whitespace. For clarity move the dropping of whitespace to the end of phase 4, after preprocessing directives are deleted. Newline characters are significant in the grammar of preprocessing directives to whitespace characters are clearly signicant until this point. Conversely, it is good to recognise that string literal preprocessing tokens are adjacted regardless of whitespace in phases 5 and 6. --- source/lex.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/lex.tex b/source/lex.tex index 7c81810132..e7fc1491de 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -157,6 +157,7 @@ A \tcode{\#include} preprocessing directive\iref{cpp.include} causes the named header or source file to be processed from phase 1 through phase 4, recursively. All preprocessing directives are then deleted. +Whitespace characters separating preprocessing tokens are no longer significant. \item For a sequence of two or more adjacent \grammarterm{string-literal} preprocessing tokens, @@ -171,7 +172,6 @@ \item Each preprocessing token is converted into a token\iref{lex.token}. -Whitespace characters separating tokens are no longer significant. The resulting tokens constitute a \defn{translation unit} and are syntactically and semantically analyzed as a \grammarterm{translation-unit}\iref{basic.link} and