One function

FreeFormattingTokenizer in terryyin/lizard

The author described this change as fix a line counting bug. It counts as a record because the check below fails on the code as it stood at c3681a0a1 and passes on 0138e46c8, with nothing else changed between the two runs.

Fix saved2014-03-30
Sharing licenceMIT · LICENSE.txt
Change size+1 1

What the code was meant to do, written into the code itself as a docstring

Use this tokenizer to tokenize C/C++, Java, ObjC code, which the format is not part of the syntax. So indentation & new lines doesn't matter.

The change

1717 r"|&=|&&|&"+
1818 r"|[!%^&\*\-=+\|\\<>/\]\+]+"+
1919 r"|\n"+
20- r"|\s+"+
20+ r"|[^\S\n]+"+
2121 r"|.)", re.M | re.S)
2222
2323 def __call__(self, source_code):

The check that tells the two apart

failpass·test/testBasicFunctionInfo.py::TestLOC::test_having_empty_line_that_has_spaces

Check file test/testBasicFunctionInfo.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 itc3681a0a17a8ac5b1a65743beb173ff5059052d8
Broken version dated2014-03-30
Modulelizard
Units changedFreeFormattingTokenizer
Fingerprint4f133372b8731b8b
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