cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

added clean C/C++ keyword lists for later usage

Open firewave opened this issue 4 years ago • 1 comments

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.

firewave avatar Jan 29 '22 14:01 firewave

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.

firewave avatar May 16 '22 13:05 firewave

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

firewave avatar Feb 19 '23 14:02 firewave