Skip to content

Wrap keywords that were \terminal{} with \keyword{} instead #7602

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

Merged
merged 1 commit into from
Jun 22, 2025

Conversation

ilazaric
Copy link
Contributor

@ilazaric ilazaric commented Feb 2, 2025

My impression is that keywords should be \keyword{<string>} usually, no surrounding command, except in one of grammar definitions, where they should be wrapped in a \terminal{...}

Didn't do this on a couple occurences in preprocessor.tex (if and else are in \terminal{} args):

\begin{bnf}\obeyspaces
\nontermdef{else-group}\br
    \terminal{\# else   } new-line \opt{group}
\end{bnf}
\begin{ncsimplebnf}\obeyspaces
\indextext{\idxcode{\#if}}%
\terminal{\# if     } constant-expression new-line \opt{group}\br
\indextext{\idxcode{\#elif}}%
\terminal{\# elif   } constant-expression new-line \opt{group}
\end{ncsimplebnf}
\begin{bnf}\obeyspaces
\nontermdef{if-group}\br
    \terminal{\# if     } constant-expression new-line \opt{group}\br
    \terminal{\# ifdef  } identifier new-line \opt{group}\br
    \terminal{\# ifndef } identifier new-line \opt{group}
\end{bnf}

I don't think these are quite the same meaning as keyword if

Also, there are many instances of keywords not being \keyword-ed in \tcode{} parts, this PR does not touch those

Additionally some minor cleanup

  • expressions.tex: \keyword{U} -> \tcode{U}
  • lex.tex: removed space between command and argument

@ilazaric
Copy link
Contributor Author

ilazaric commented Feb 15, 2025

Last commit fixes spacing in overloading.tex, bnf for operator (that I broke in previous commits to this PR)
I originally didn't realize the spacing was important
Rendered and it looks good:
image

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.

Looks good.

@jensmaurer
Copy link
Member

Please rebase.

@jensmaurer jensmaurer added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Mar 22, 2025
@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 17, 2025

@ilazaric: Could you please rebase?

@ilazaric ilazaric force-pushed the keyword-related-cleanup branch from 0c1a7de to 607860c Compare June 21, 2025 18:02
@ilazaric
Copy link
Contributor Author

Apologies
I've rebased and resolved conflicts
I regenerated std.pdf and spot checked the affected locations, looks good to me, example:
image

@jensmaurer jensmaurer removed the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Jun 21, 2025
@jensmaurer
Copy link
Member

Looks good.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 21, 2025

Could you tell me the correctly phrased commit message? It's OK to keep things in one commit, but we should state the affected subclauses. So something like "[foo.bar, xy.zw] Use "\keyword" instead of "\terminal"". (Don't worry about changing the commit, I can do that at application time. I would just appreciate you looking up the references.)

@ilazaric
Copy link
Contributor Author

[expr.prim.lambda.capture], [expr.post.general]/1, [expr.await]/1, [expr.yield], [lex.bool], [lex.nullptr], [over.call.object]/2, [over.oper.general]/1, [cpp.include]/7, [stmt.return.coroutine], [stmt.return.coroutine]/2, [temp.res.general]/2

Note [stmt.return.coroutine] is changed in 0th and 2nd paragraph
Just FYI, if I didn't write a /number, it is because the change occurs before the first paragraph
I was considering writing /0 , but looking at git log this doesn't seem to be common practice

Alternate format:
[expr.prim.lambda.capture, expr.post.general/1, expr.await/1, expr.yield, lex.bool, lex.nullptr, over.call.object/2, over.oper.general/1, cpp.include/7, stmt.return.coroutine, stmt.return.coroutine/2, temp.res.general/2]

Alternate without paragraph numbers:
[expr.prim.lambda.capture, expr.post.general, expr.await, expr.yield, lex.bool, lex.nullptr, over.call.object, over.oper.general, cpp.include, stmt.return.coroutine, temp.res.general]

@tkoeppe tkoeppe merged commit a4e8211 into cplusplus:main Jun 22, 2025
2 checks passed
@ilazaric ilazaric deleted the keyword-related-cleanup branch June 22, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants