cppcheck
cppcheck copied to clipboard
added clean C/C++ keyword lists for later usage
There are various hard-coded lists of these across the code. Some of them are even incomplete, contain non-keywords or attribute keywords to a standard they do not belong to.
This is in preparation so those instances can be incrementally be replaced with these proper global lists.
The interface might not be the best. I will try to replace 1 or 2 of the existing usages locally first to see if it actually makes sense.
Using the static lists instead of building them on-demand in TokenList should speed up the tests - especially the scanf/printf ones in TestIO.
before:
Benchmark 1: bin/testrunner TestIO
Time (mean ± σ): 2.771 s ± 0.053 s [User: 2.556 s, System: 0.194 s]
Range (min … max): 2.689 s … 2.821 s 5 runs
after:
Benchmark 1: bin/testrunner TestIO
Time (mean ± σ): 1.967 s ± 0.072 s [User: 1.806 s, System: 0.161 s]
Range (min … max): 1.860 s … 2.036 s 5 runs