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
Connect pp-import to the preprocessor grammar #3575
Conversation
Clarify how the grammar pp-import relates to control-line.
@@ -671,6 +676,9 @@ | |||
\indextext{header unit!preprocessing}% | |||
\indextext{macro!import|(}% | |||
|
|||
\pnum | |||
An \grammarterm{import-line} shall be of the form |
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.
For "of the form" constraints, we usually don't show another non-terminal, but just the grammar sequence that needs to be satisfied. That said, I think the overall change is a net improvement.
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.
I noticed that, but the subsequent text refers to things like "all three forms of pp-import" etc. So I thought it nice to keep that name. I suppose we could change it to "all three forms above" and "the second form", etc. Not sure if that would be better though.
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.
We do the same thing in [class.conv.fct], which is much more egregious than this (it lists three productions and only means the first one). Though I do wonder if we can do better here; perhaps we could list pp-import as a control-line production (perhaps renaming it to import-line), and change [cpp.pre]/2 to say that a text-line is only matched if the line is not a preprocessor directive. (That way, an import directive that's not a pp-import would simply not match the preprocessor grammar, just like an unmatched #if
or #endif
.)
Please rebase and force-push. |
@daveedvdv: Could you please take @zygoloid's suggestion into consideration? And rebase? |
We're not sure if this is editorial. We agree that there's a bug in the wording, but the detailed resolution needs oversight, too, so could you please raise this proposal as a CWG issue? |
Fixed by 862fe4b (Feb 2020) |
Clarify how the grammar pp-import relates to control-line.