Skip to content
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

Fix hanging paragraphs for C++20 #4169

Merged
merged 1 commit into from Sep 9, 2020

Conversation

zygoloid
Copy link
Member

@zygoloid zygoloid commented Sep 9, 2020

Mechanically fix all hanging paragraphs by adding "General" sections.

For C++23, we should go through these and rename them as appropriate, but for C++20 let's just mechanically call them all "General" and name them [foo.general].

Fixes cplusplus/nbballot#394.

Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm creating an extension for tools/check.sh to detect hanging paragraphs using sed and awk.

@@ -2084,6 +2090,8 @@
\indextext{specifier|)}%

\rSec1[dcl.decl]{Declarators}%

\rSec2[dcl.decl.general]{General}%
\indextext{declarator|(}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not nice; the "declarator" start of index range should probably be before the "General" section. But maybe this is not the right time to fiddle with this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix this for the master branch. I think this is fine for C++20.

@JohelEGP
Copy link
Contributor

JohelEGP commented Sep 9, 2020

Fixes #3525 (I think).
Partially addresses #1771.
Related to #1730 and #574.

@zygoloid
Copy link
Member Author

zygoloid commented Sep 9, 2020

Fixes #3525 (I think).

Well, technically this PR doesn't fix #3525, but the merge to master will :)

@zygoloid
Copy link
Member Author

zygoloid commented Sep 9, 2020

I'm creating an extension for tools/check.sh to detect hanging paragraphs using sed and awk.

Ah, we were both working on this at the same time. I built a perl script to do this; do you prefer one approach or the other?

@jensmaurer
Copy link
Member

My check script is here: #4170

@JohelEGP
Copy link
Contributor

JohelEGP commented Sep 9, 2020

Fixes #3525 (I think).

Well, technically this PR doesn't fix #3525, but the merge to master will :)

Maybe not:

# FIXME: We should also check for subclauses that have no siblings.

Does your script fix this, @jensmaurer?

@jensmaurer
Copy link
Member

jensmaurer commented Sep 9, 2020

@zygoloid , your script introduces a dependency on perl, which is novel for the check.sh script. My variant just uses sed and awk.

@JohelEGP , no, my script does not check for lone siblings. I think those only currently appear together with hanging paragraphs.

@JohelEGP
Copy link
Contributor

JohelEGP commented Sep 9, 2020

I've marked as done those that will be fixed by this. Please, do check the others: #3525.

@jensmaurer jensmaurer added the ballot-comment Response to an NB or ISO comment on a ballot label Sep 9, 2020
@jensmaurer jensmaurer added this to the C++20 milestone Sep 9, 2020
@zygoloid
Copy link
Member Author

zygoloid commented Sep 9, 2020

@zygoloid , your script introduces a dependency on perl, which is novel for the check.sh script. My variant just uses sed and awk.

For what it's worth, using perl here is actually more portable than your uses of awk (which rely on GNU awk-isms, and consequently don't work out of the box on Mac OS). But I'm fine sticking with something more similar to what we already do here if there's a worry that perl won't be available. Dropping the checking part from this PR.

@zygoloid zygoloid merged commit 2fe6255 into cplusplus:c++20 Sep 9, 2020
@jensmaurer
Copy link
Member

@zygoloid , I think I'm not using GNU awk specifics, at least not in the "hanging paragraph" check.
(I think you discovered a GNU sed dependency, though.)

@zygoloid
Copy link
Member Author

zygoloid commented Sep 9, 2020

Sorry, you're right, it's sed not awk that's the problem in this script in general.

@zygoloid
Copy link
Member Author

zygoloid commented Sep 9, 2020

See also follow-up fixes #4173 and #4174.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ballot-comment Response to an NB or ISO comment on a ballot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants