Whole file
terryyin/lizard
The author described this change as “fix the swift 'optional' question mark”. It counts as a record because the check below fails on the code as it stood at 2823730ab and passes on 714fefb65, with nothing else changed between the two runs.
Projectterryyin/lizard
Fix saved2016-03-31
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 the swift 'optional' question mark
The change
| 16 | 16 | super(SwiftReader, self).__init__(context) | |
| 17 | 17 | self.parallel_states = [SwiftStates(context)] | |
| 18 | 18 | ||
| 19 | + | @staticmethod | |
| 20 | + | def generate_tokens(source_code, _=""): | |
| 21 | + | return CodeReader.generate_tokens( | |
| 22 | + | source_code, | |
| 23 | + | r"|\w+\?" + | |
| 24 | + | r"|\w+\!" + | |
| 25 | + | _) | |
| 26 | + | ||
| 19 | 27 | ||
| 20 | 28 | class SwiftStates(CodeStateMachine): # pylint: disable=R0903 | |
| 21 | 29 | def _state_global(self, token): |
The check that tells the two apart
fail→pass·test/testSwift.py::Test_parser_for_Swift::test_optional
Check file test/testSwift.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 it2823730ab1cab2e1efc9c9292e3292a8b5b10494
Broken version dated2016-03-26
Modulelizard_languages.swift
Units changedSwiftReader
Fingerprintf132124aff93da72
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)