Whole file

terryyin/lizard

The author described this change as fix(script): stop a '#' comment continuing past a trailing backslash (#317). It counts as a record because the check below fails on the code as it stood at ceb899aac and passes on 712d44f77, with nothing else changed between the two runs.

Fix saved2026-06-11
Sharing licenceMIT · LICENSE.txt
Change size+5 2

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

fix(script): stop a '#' comment continuing past a trailing backslash (#317)

The change

2424
2525 @staticmethod
2626 def generate_common_tokens(source_code, addition, match_holder=None):
27- _until_end = r"(?:\\\n|[^\n])*"
27+ # A '#' line comment ends at the newline; a trailing backslash does
28+ # not continue it onto the next line (issue #317). C/C++ '//' comments,
29+ # which legitimately continue on a backslash, go through CodeReader
30+ # directly and are unaffected.
2831 return CodeReader.generate_tokens(
2932 source_code,
30- r"|\#" + _until_end + addition,
33+ r"|\#[^\n]*" + addition,
3134 match_holder)
3235

The check that tells the two apart

failpass·test/test_languages/testRuby.py::Test_Ruby_comment_line_continuation::test_backslash_at_end_of_comment_keeps_next_line

Check file test/test_languages/testRuby.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 itceb899aac22ea637aa0b4f07e72dee1224933762
Broken version dated2026-06-11
Modulelizard_languages.script_language
Units changedScriptLanguageMixIn
Fingerprint9ac42ae5eb897824
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