You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to clause [lex.phases], phase 3 occurs previous to phase 4, In other words, the determination of preprocessing tokens occurs before the execution of preprocessing directives.
phase 3:
The source file is decomposed into preprocessing tokens ([lex.pptoken]) and sequences of whitespace characters (including comments).
phase 4:
Preprocessing directives are executed, macro invocations are expanded, and _Pragma unary operator expressions are executed.
That is, the replacement of preprocessing tokens import to import-keyword, module to module-keyword, and export to export-keyword all occur within the duration of execution of preprocessing directives. As specified in [cpp.module], and [cpp.import], they are:
The module and export (if it exists) preprocessing tokens are replaced by the module-keyword and export-keyword preprocessing tokens respectively.
In all three forms of pp-import, the import and export (if it exists) preprocessing tokens are replaced by the import-keyword and export-keyword preprocessing tokens respectively.
The emphasized parts also confirm this point. We should admit that: import, module, and export are preprocessing tokens in phase 3. They also remain to be preprocessing tokens until the execution of the relevant preprocessing directives in phase 4. After these phases, these replaced x-keywords will be used as keywords in the subsequent phases.
The text was updated successfully, but these errors were encountered:
export, import, module clearly are (lexical) preprocessing-tokens (identifier in [lex.pptoken])
and the x-keyword things are also preprocessing tokens per [lex.pptoken]; they are mentioned explicitly in the grammar for preprocessing-token.
You're correct on that the identifiers cover the original "import", "module", and "export" things. [lex.key] p1 should also cover the resulted things from the former.
According to clause [lex.phases], phase 3 occurs previous to phase 4, In other words, the determination of preprocessing tokens occurs before the execution of preprocessing directives.
phase 3:
phase 4:
That is, the replacement of preprocessing tokens import to import-keyword, module to module-keyword, and export to export-keyword all occur within the duration of execution of preprocessing directives. As specified in [cpp.module], and [cpp.import], they are:
The emphasized parts also confirm this point. We should admit that: import, module, and export are preprocessing tokens in phase 3. They also remain to be preprocessing tokens until the execution of the relevant preprocessing directives in phase 4. After these phases, these replaced x-keywords will be used as keywords in the subsequent phases.
The text was updated successfully, but these errors were encountered: