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.

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

3030 CLikeNestingStackStates(context),
3131 CppRValueRefStates(context))
3232
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+
3341 def preprocess(self, tokens):
3442 tilde = False
3543 for token in tokens:

The check that tells the two apart

failpass·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