Closed
Description
It's pretty easy to get lists of uses of \grammarterm and \nontermdef, and to compare them:
grep -oP --no-filename '(?<=\\nontermdef{)[^}]*(?=})' *.tex | sort | uniq > defined_grammarterms.txt
grep -oP --no-filename '(?<=\\grammarterm{)[^}]*(?=})' *.tex | tr A-Z a-z | sort | uniq > used_grammarterms.txt
comm -23 used_grammarterms.txt defined_grammarterms.txt
This finds the following uses of \grammarterm that don't have a corresponding \nontermdef:
attribute-specifier-seq\opt
begin-expr
brace-or-equal-initializers
call-function
class-name-or-namespace-name
copy-list-initialization
cv-list
cv-qualifer-seq
cv-qualifiers
cv-qualifier-seq\opt
decl-specifiers
default-initialize
direct-list-initialization
dynamic-cast
end-expr
explicitly-defaulted
function-local predefined variable
function-name
function-specifiers
init-declarators
initializer-list constructor
injected-class-name
integer-constant
integer representation of a safely-derived pointer
italic
label
list-initialization
local
mem-initializers
more cv-qualified
nested
nested-name-specifier\opt
non-trivial
non-type argument
non-type parameter
non-virtual
over-aligned type
overloaded
ref-qualifier\opt
root-directory\opt
root-name\opt
root-path
safely-derived pointer
standard-layout class
standard-layout struct
standard-layout union
switch-statement
tem\-plate-argument
template-argument-list.
typedef
type-dependent
typeid
unnamed
user-defined conversion sequence
using-directives
value-dependent
x
x-id
x-list
x-name
x-seq
zero-initialize
I think at most a couple of these are ok, all the rest are bad as far as I can tell.
So maybe this could be a Travis check, possibly with a short whitelist. I suppose all current bad uses would have to be fixed first though. Thoughts?
Activity
Eelis commentedon Mar 16, 2017
Update: Recent commits fixed a lot of bad uses! The list now is:
Eelis commentedon Mar 18, 2017
Update: Capitalized \grammarterms are also considered bad, see #1519. Removing the
tr A-Z a-z
from the script, the list becomes:Eelis commentedon Mar 20, 2017
Recent commits fixed many bad uses, reducing the list to:
We're nearly there! :)
Eelis commentedon Oct 17, 2017
Update: by now the list has been reduced to:
jensmaurer commentedon Dec 1, 2017
dot and dot-dot are addressed by #1527.
x-something is from the introduction in [syntax]; the "x" is a placeholder. I don't think we should change this.
Eelis commentedon Dec 10, 2017
In my last update, I forgot to include the capitalized grammarterms that are also considered bad (#1519). These also still exist:
jensmaurer commentedon Feb 13, 2018
#1858 fixed the last remnants of these.