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

Possible CI check: bad use of \grammarterm #1543

Closed
Eelis opened this issue Mar 15, 2017 · 7 comments
Closed

Possible CI check: bad use of \grammarterm #1543

Eelis opened this issue Mar 15, 2017 · 7 comments

Comments

@Eelis
Copy link
Contributor

Eelis commented Mar 15, 2017

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?

@Eelis
Copy link
Contributor Author

Eelis commented Mar 16, 2017

Update: Recent commits fixed a lot of bad uses! The list now is:

attribute-specifier-seq\opt
begin-expr
call-function
class-name-or-namespace-name
cv-list
cv-qualifier-seq\opt
dot
dot-dot
end-expr
explicitly-defaulted
function-local predefined variable
function-name
initializer-list constructor
injected-class-name
integer-constant
italic
list-initialization
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
x
x-id
x-list
x-name
x-seq

@Eelis
Copy link
Contributor Author

Eelis commented 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:

attribute-specifier-seq\opt
begin-expr
call-function
class-name-or-namespace-name
Class-specifier
cv-list
cv-qualifier-seq\opt
dot
dot-dot
end-expr
explicitly-defaulted
Function-definition
function-local predefined variable
function-name
Function-specifier
injected-class-name
integer-constant
italic
Namespace-definition
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
X
X-id
X-list
X-name
X-seq

@Eelis
Copy link
Contributor Author

Eelis commented Mar 20, 2017

Recent commits fixed many bad uses, reducing the list to:

call-function
class-name-or-namespace-name
Class-specifier
cv-list
dot
dot-dot
explicitly-defaulted
Function-definition
function-local predefined variable
function-name
Function-specifier
injected-class-name
integer-constant
italic
Namespace-definition
root-path
X
X-id
X-list
X-name
X-seq

We're nearly there! :)

@Eelis
Copy link
Contributor Author

Eelis commented Oct 17, 2017

Update: by now the list has been reduced to:

call-function
class-name-or-namespace-name
dot
dot-dot
italic
parameter
preprocessing-tokens
root-path
x
x-id
x-list
x-name
x-seq

@jensmaurer
Copy link
Member

jensmaurer commented 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
Copy link
Contributor Author

Eelis commented Dec 10, 2017

In my last update, I forgot to include the capitalized grammarterms that are also considered bad (#1519). These also still exist:

classes.tex:25:\grammarterm{Class-specifier}{s} and
declarations.tex:82:\grammarterm{Function-definition}{s} are described in~\ref{dcl.fct.def} and
declarations.tex:496:\grammarterm{Function-specifier}{s}
declarations.tex:85:\grammarterm{Namespace-definition}{s} are described in~\ref{namespace.def},

@jensmaurer
Copy link
Member

#1858 fixed the last remnants of these.

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

No branches or pull requests

2 participants