Skip to content

Possible CI check: bad use of \grammarterm #1543

@Eelis

Description

@Eelis

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions