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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs rebase The pull request needs a git rebase to resolve merge conflicts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants