[lex.pptoken] Separate out keyword placeholders#7381
Open
AlisdairM wants to merge 1 commit into
Open
Conversation
9746dfc to
ed6f6ae
Compare
Member
|
Are these "placeholder keywords" or rather "keyword placeholders"? |
Contributor
Author
That is a good question. In phases 3 and 4 the emphasis is on placeholder. In phase 7 the emphasis is on keyword. In both cases we are dealing with the same ephemeral. notion of token-but-not-otherwise-representable-in-the-grammar. I believe the refactoring of my PR is helpful, and am happy if we find better vocabulary to revise it. |
ed6f6ae to
7f8c4d7
Compare
Contributor
Author
|
Thought about it some more, and agreed with Jens. Applied updated wording. |
7f8c4d7 to
91dd967
Compare
Member
|
New grammar production -> CWG should have a look. |
91dd967 to
a8be5b3
Compare
a8be5b3 to
5a2c7aa
Compare
5a2c7aa to
83ff729
Compare
The _preprocessing-token_ term is defined as one of another set of grammar productions, with the three placeholder tokens standing out as specific single tokens. Moving the placeholder tokens into their own production simplifies both the _preprocessing-token_ and _keyword_ grammar productions, plus it guarantees a consistency for the set of placeholder between both places. It also makes it easier for [cpp] to directly cross-reference where needed. Pedantically, the term placeholder token itself is problematic as tokens are a phase 7 concern, where they become keywords. Within the earlier phases where these placeholders are used the correct term is a preprocessing token, so strictly these should be placeholder preprocessing tokens, which is a mouthful. So renaming the term to placeholder keyword, which is hopefully less of a concern as there are no keywords in phase 3--6 to confuse with phase 7 keywords. Finally, clean up the informative list in text of the various kinds of preprocessing tokens, rendering as a list in the source (one kind per line) and adding a cross-reference to each such item.
83ff729 to
ce6a617
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The preprocessing-token term is defined as one of another set of grammar productions, with the three placeholder tokens standing out as specific single tokens.
Moving the placeholder tokens into their own production simplifies both the preprocessing-token and keyword grammar productions, plus it guarantees a consistency for the set of placeholder between both places. It also makes it easier for [cpp] to directly cross-reference where needed.
Pedantically, the term placeholder token itself is problematic as tokens are a phase 7 concern, where they become keywords. Within the earlier phases where these placeholders are used the correct term is a preprocessing token, so strictly these should be placeholder preprocessing tokens, which is a mouthful. So renaming the term to placeholder keyword, which is hopefully less of a concern as there are no keywords in phase 3--6 to confuse with phase 7 keywords.
Finally, clean up the informative list in text of the various kinds of preprocessing tokens, rendering as a list in the source (one kind per line) and adding a cross-reference to each such item.