py/makecompresseddata.py: Don't prefix str with mark if not compressed.

This commit is contained in:
Damien George 2020-04-09 17:33:36 +10:00
parent 8e048d2548
commit 7654907e1e

View File

@ -168,7 +168,11 @@ def main(collected_path, fn):
# Print the replacements. # Print the replacements.
for uncomp, comp in error_strings.items(): for uncomp, comp in error_strings.items():
print('MP_MATCH_COMPRESSED("{}", "\\{:03o}{}")'.format(uncomp, _COMPRESSED_MARKER, comp)) if uncomp == comp:
prefix = ""
else:
prefix = "\\{:03o}".format(_COMPRESSED_MARKER)
print('MP_MATCH_COMPRESSED("{}", "{}{}")'.format(uncomp, prefix, comp))
# Used to calculate the "true" length of the (escaped) compressed strings. # Used to calculate the "true" length of the (escaped) compressed strings.
def unescape(s): def unescape(s):