-
Notifications
You must be signed in to change notification settings - Fork 805
[lex.separate][module.unit] move definitions of program and translation unit #7180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Just to confirm that I looked at every reference for program and translation unit to see if they had a cross reference that should be updated. These terms occur quite frequently, but rarely have a cross-reference, and in those places that do have a cross reference, they are frequently cross referencing a concept in the whole sentence rather than a definition of either term. |
86d979a to
413da6a
Compare
|
Note to CWG chair: this PR, if accepted, would seem to be making progress towards resolving http://wg21.link/cwg2670. |
413da6a to
be3e611
Compare
ed14973 to
6b5b3b1
Compare
source/modules.tex
Outdated
| \nontermdef{translation-unit}\br | ||
| \opt{declaration-seq}\br | ||
| \opt{global-module-fragment} module-declaration \opt{declaration-seq} \opt{private-module-fragment} | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A translation-unit is not necessarily a module unit, so I find this new place not good. I agree having this production in [lex] is not good, either, because this is a phase 7 grammar production. I agree that [basic.link] isn't a great place, so it's either [basic.pre] or a new subclause [basic.program].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking again, I think the best location is to introduce [basic.def]. What you you think?
6b5b3b1 to
3f83595
Compare
3f83595 to
1a45c36
Compare
|
Rebased with wording better targeted at relevant clauses, and clearly addressing a resolution to CWG2670. |
…on unit The definition of program at the top of [basic.link] should move to the front of [lex.separate] so that it is defined before its first usage, and also clarifies that is what the phases of translation produce. Similarly, move the definition of the grammar production translation-unit to the top of [basic.def] which contains the practical definition. Finally, retitle [basic.link] as just Linkage, rather than Programs and linkage.
1a45c36 to
7dc1d8a
Compare
|
This does more than moving stuff around (which makes review harder), and will have a merge conflict with the approved CWG3091. |
|
Note that it does apply the resolution to CWG3091 in the words that it moves. Other than moving words --- one paragraph split into two locations --- it updates all relevant links to where the words used to occur. Some of those cross-references are simply removed, not redirected, as the words land close to the location that was making a cross-reference. I believe the only other change I made was to drop "Programs and" from the subclause header "Programs and linkage", without touching any of the stable labels. I also believe the new locations for both definitions are much more suited than where they were, or I would not have submitted the PR ;) |
|
I also expect to push an update with conflict resolution after the Kona motions land. |
The definition of program at the top of [basic.link] should move to the front of [lex.separate] so that it is defined before its first usage, and also clarifies what the phases of translation produce.
The description of translation unit in [basic.link] is provided only to support the definition of program. However, that description is no longer useful now that the term has a definition in [lex.phases]. The description is also never referenced In the rest of [basic.link]. If we remove that description, then there is nothing tying the definition of the grammar term translation-unit to [basic.link] either, so move it to the place where that definition is most useful, at the top of
[module.unit][basic.def].It is tempting to move the grammar definitions of global-module-framgment and private-module-framgment to the collected grammar at the top of this clause two, but leaving them in their current subclauses for now, pending further feedack.Finally, retitle [basic.link] as just Linkage, rather than Programs and linkage, as the subclause was never about the terms described in the opening paragraph and never mention again (within this clause).