One function
CLikeNestingStackStates in terryyin/lizard
The author described this change as “fix https://github.com/terryyin/lizard/issues/134”. It counts as a record because the check below fails on the code as it stood at c603f7f2c and passes on 524fc21bd, with nothing else changed between the two runs.
Projectterryyin/lizard
Fix saved2016-06-24
Sharing licenceMIT · LICENSE.txt
Change size+1 −1
What the code was meant to do, written into the code itself as a docstring
Machinery to track nesting levels of tokens. The main indicators of nesting are braces: '{' and '}'. However, the code is complicated due to braceless structures, which are control-flow structures in C-like languages. Moreover, using braces as nesting level indicators leads to a big caveat; C++ initializer lists, uniform initialization, and any other constructs with braces add extra nesting level. Another complication comes from nested classes inside function bodies and control-flow declarations/bodies. The handling of these complex cases is unspecified and can be ignored.
The change
| 80 | 80 | else: | |
| 81 | 81 | self._state = self.__declare_structure | |
| 82 | 82 | ||
| 83 | - | @CodeStateMachine.read_until_then('({;') | |
| 83 | + | @CodeStateMachine.read_until_then(')({;') | |
| 84 | 84 | def _read_namespace(self, token, saved): | |
| 85 | 85 | self._state = self._state_global | |
| 86 | 86 | if token == "{": |
The check that tells the two apart
fail→pass·test/test_languages/testCAndCPP.py::Test_c_cpp_lizard::test_struct_in_param
Check file test/test_languages/testCAndCPP.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itc603f7f2ce8eb76b57c18eb17ab37c5a26c88d86
Broken version dated2016-06-24
Modulelizard_languages.clike
Units changedCLikeNestingStackStates
Fingerprint782f93a9845050eb
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in terryyin/lizard
- 2026-08-08fix(java): do not report control structures as methods
- 2026-07-02HalsteadClassifier
- 2026-07-02fix(csv): emit columns for extensions with multiple FUNCTION_INFO fields
- 2026-06-15fix(golike): register generic functions with [...] type params
- 2026-06-15fix(java): enhance parsing of generic and qualified type names in anonymous classes
- 2026-06-11fix(script): stop a '#' comment continuing past a trailing backslash (#317)