Cleanup: Remove unused-strings hack for _TINY string variants.

This commit is contained in:
Peter Nelson 2024-12-07 15:52:52 +00:00 committed by Peter Nelson
parent 5575c0ba5a
commit 369e8a6fe9

View File

@ -39,7 +39,6 @@ def read_language_file(filename, strings_found, errors):
skip = SkipType.NONE
length = 0
common_prefix = ""
last_tiny_string = ""
with open(filename) as fp:
for line in fp.readlines():
@ -114,17 +113,6 @@ def read_language_file(filename, strings_found, errors):
name = line.split(":")[0].strip()
strings_defined.append(name)
# If a string ends on _TINY or _SMALL, it can be the {TINY} variant.
# Check for this by some fuzzy matching.
if name.endswith(("_SMALL", "_TINY")):
last_tiny_string = name
elif last_tiny_string:
matching_name = "_".join(last_tiny_string.split("_")[:-1])
if name == matching_name:
strings_found.add(last_tiny_string)
else:
last_tiny_string = ""
if skip == SkipType.EXTERNAL:
strings_found.add(name)
skip = SkipType.LENGTH