Whole file
terryyin/lizard
The author described this change as “fix: https://github.com/terryyin/lizard/issues/295”. It counts as a record because the check below fails on the code as it stood at cece7909d and passes on fed797ce7, with nothing else changed between the two runs.
Projectterryyin/lizard
Fix saved2025-02-04
Sharing licenceMIT · LICENSE.txt
Change size+8 −0
What the code was meant to do, written into the code itself as a save note
fix: https://github.com/terryyin/lizard/issues/295
The change
| 30 | 30 | CLikeNestingStackStates(context), | |
| 31 | 31 | CppRValueRefStates(context)) | |
| 32 | 32 | ||
| 33 | + | @staticmethod | |
| 34 | + | def generate_tokens(source_code, addition='', token_class=None): | |
| 35 | + | # Add pattern for floating point literals to the token generation | |
| 36 | + | addition = r"|(?:\d*\.\d+(?:[eE][-+]?\d+)?)" + \ | |
| 37 | + | r"|(?:\d+\.(?:\d+)?(?:[eE][-+]?\d+)?)" + \ | |
| 38 | + | addition | |
| 39 | + | return CodeReader.generate_tokens(source_code, addition, token_class) | |
| 40 | + | ||
| 33 | 41 | def preprocess(self, tokens): | |
| 34 | 42 | tilde = False | |
| 35 | 43 | for token in tokens: |
The check that tells the two apart
fail→pass·test/test_languages/testCAndCPP.py::Test_c_cpp_lizard::test_aggregate_initialization_with_double
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 itcece7909d9eb884622d23896eb7db60ad7a7fca9
Broken version dated2025-02-04
Modulelizard_languages.clike
Units changedCLikeReader
Fingerprint8eb2b650f72a49a3
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)