Whole file

terryyin/lizard

The author described this change as fix the elseif statement for fortran. It counts as a record because the check below fails on the code as it stood at 00e10094f and passes on ff1928bd9, with nothing else changed between the two runs.

Fix saved2024-10-31
Sharing licenceMIT · LICENSE.txt
Change size+4 3

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

fix the elseif statement for fortran

The change

3535 _until_end = r'(?:\\\n|[^\n])*'
3636 return CodeReader.generate_tokens(
3737 source_code,
38- r'(?i)' +
39- r'|\/\/' +
38+ r'(?i)'
39+ r'\/\/' +
4040 r'|\#' + _until_end +
4141 r'|\!' + _until_end +
42- r'|^C' + _until_end +
4342 r'|^\*' + _until_end +
4443 r'|\.OR\.' +
4544 r'|\.AND\.' +
124123 self.context.add_bare_nesting()
125124 elif token_upper.replace(' ', '') == 'ELSEIF':
126125 self.context.pop_nesting()
126+ if token_upper == 'ELSEIF':
127+ self.context.add_condition()
127128 self._state = self._if
128129 elif token_upper == 'END' or self._ends.match(token):
129130 self.context.pop_nesting()

The check that tells the two apart

failpass·test/test_languages/testFortran.py::TestFortran::test_case_insensitive_tokens

Check file test/test_languages/testFortran.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 it00e10094f57b65b538855a717a2412201cc18a97
Broken version dated2024-10-08
Modulelizard_languages.fortran
Units changedFortranReader, FortranStates
Fingerprintd0c977c89fd10608
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