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 bnf / bnftab / bnfkeywordtab mess #1821
Comments
There's also |
@jensmaurer: That's the "non-copying" version that doesn't get extracted into the grammar summary. |
@tkoeppe: Sure, but why do we sometimes use |
Ok, I have a bnf environment where |
It seems the "tabto" package does what I want, even inside enumerations; see https://tex.stackexchange.com/questions/15628/ . Before I go there (and introduce yet another package dependency), @zygoloid should advise whether we want to keep the aligned grammar presentation in [cpp]. If yes, I'll go for the extra package; if no, I'll remove |
Here's what [cpp] looks like without the That seems fine to me. Other opinions solicited (@tkoeppe?) |
@tkoeppe: What's your opinion? |
Is [cpp] the only instance where we have additional alignment apart from the first one? If so, I think that can go. I'd be happy to lose the entire set of macros related to tabbing. It might be nice to see the impact of such a change on [lex], where we mix the two kinds of grammar environments. |
It looks like we can replace |
In [stmt] we use bnftab environments to indent and then exdent again. The plain "bnf" environment can't do that, since it indents all lines but the first, and simplebnf doesn't come with any indentation tools at all (I think). |
...but I can trivially provide such an indentation aid :-) |
I got rid of all bnftabs except the ones in [cpp]. We just need to decide whether we're OK with dropping the alignment. |
Removed raw |
No more uses of |
I sidestepped the discussion around [cpp] by aligning the grammar with spaces (rather than tabbing) in 7f84786. |
Fixed by e964cd7. |
We currently have mutliple "bnf" environments:
bnf
is used for most normal grammar snippets. It does not support\>
for indenting wrapped continuation lines.bnftab
is used for some grammar snippets. Upside: it supports\>
for indenting continuation lines. Downside: it does not automatically indent the body of a grammar definition. Each line must be prefixed with\>
.bnfkeywordtab
is used for "keyword" lists in the grammar. Actually, it's only used for lists of operators (one in [lex], one in [over]), since our lists of keywords are in tables not in the grammar at all.You would think that we would use
bnftab
when we need to wrap a line, andbnf
otherwise. But actually, we usebnftab
for the grammar in [lex] (some of which is wrapped) and for non-grammar snippets such as the rewrite rules in [stmt], and we usebnf
for the rest of the grammar, including cases that need line wraps (where the wrapping is constructed manually using\hspace*
).This is a mess. We should make
\>
work inbnf
environments, and removebnftab
. We should also consider renamingbnfkeywordtab
since it's not actually used for keywords (the only difference between it andbnftab
is that text is by default in teletype rather than in italics).The text was updated successfully, but these errors were encountered: