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

[over.call.func, gram.key] Make colon in bnf non-italic. #4385

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Eelis
Copy link
Contributor

@Eelis Eelis commented Nov 22, 2020

No description provided.

@Eelis Eelis changed the title [over.call.func] Make colon in bnf non-italic. [over.call.func, gram.key] Make colon in bnf non-italic. Nov 23, 2020
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.

For "normal" bnf, we have \nontermdef for the initial thing.

"ncbnf" are the non-copied BNF parts (those that aren't copied to Annex A), but we should have a similar macro defined there, instead of hand-adding a colon or (gosh) hand-changing it to \textnormal.

@godbyk
Copy link
Contributor

godbyk commented Nov 23, 2020

We could make the colon an “active character.” This would allow you to just type an unadorned colon in the source (within the BNF environments) and LaTeX would interpret it as a macro that expands to \textnormal{:} (or similar).

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 23, 2020

@jensmaurer's suggestion sounds somewhat more structured -- what do you think? That way people don't have to remember to type colons at all.

@godbyk
Copy link
Contributor

godbyk commented Nov 23, 2020

As long as \nontermdef is only used for the symbol being defined, then that'd work just fine.

@@ -745,7 +745,7 @@
parentheses, has one of the following forms:

\begin{ncbnf}
postfix-expression:\br
postfix-expression\textnormal{:}\br
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this line add any value? Can it be removed?

By moving \fmtnontermdef to macros.tex and renaming it
to \ninontermdef, for "Non-Indexed \nontermdef", analogous
to how ncbnf means "Non-Copied bnf".
@Eelis
Copy link
Contributor Author

Eelis commented Nov 24, 2020

I noticed there was already a non-indexed version of \nontermdef used for format nontermdefs: \fmtnontermdef.

So I've changed the patch to:

  • move that \fmtnontermdef to macros.tex
  • rename it to \ninontermdef for "Non-Indexed nontermdef" (similar to how "ncbnf" means "Non-Copied bnf")
  • use \ninontermdef in the new places to fix the italic colons.

@@ -573,7 +573,8 @@

\newenvironment{bnfbase}
{
\newcommand{\nontermdef}[1]{{\BnfNontermshape##1\itcorr}\indexgrammar{\idxgram{##1}}\textnormal{:}}
\newcommand{\nontermdef}[1]{{\BnfNontermshape##1\itcorr}\indexgrammar{\idxgram{##1}}\textnormal{:}}%
Copy link
Member

Choose a reason for hiding this comment

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

Drop the trailing percent; it has no use inside macros.tex

@@ -19238,7 +19238,6 @@
% FIXME: For now, keep the format grammar productions out of the index, since
% they conflict with the main grammar.
% Consider renaming these en masse (to fmt-* ?) to avoid this problem.
\newcommand{\fmtnontermdef}[1]{{\BnfNontermshape#1\itcorr}\textnormal{:}}
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer if you would leave the uses of \fmtnontermdef as-is and just changed its definition to be \ninontermdef.
(This keeps the semantic markup of the fmt-related grammar.)
Maybe we want to add an index of fmt-related grammar at some later time.

@jensmaurer jensmaurer added the changes requested Changes to the wording or approach have been requested and not yet applied. label Dec 14, 2020
@wg21bot wg21bot added the needs rebase The pull request needs a git rebase to resolve merge conflicts. label Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested Changes to the wording or approach have been requested and not yet applied. 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.

None yet

6 participants