mirror of
https://github.com/elliotnunn/ToolboxToolbox.git
synced 2025-02-07 03:31:49 +00:00
More cosmetic fixes to FirstPass
This commit is contained in:
parent
8b59328410
commit
62a655aeff
@ -110,6 +110,11 @@ for name, firstline, lastline in procedures:
|
||||
# Now we have a clean statement list that we can do transformations on.
|
||||
|
||||
|
||||
# Transformation: A7 to SP
|
||||
statements = re.sub(r'(?<!\$)\bA7\b', 'SP', statements)
|
||||
|
||||
|
||||
|
||||
# Transformation: get rid of unused labels
|
||||
def label_if_nonunique(m):
|
||||
if len(re.findall(r'\b' + m.group()[:-1] + r'\b', statements)) > 1:
|
||||
@ -152,7 +157,7 @@ for name, firstline, lastline in procedures:
|
||||
|
||||
# Transformation: change #$70777063 to #'pwpc'
|
||||
def longliteral(m):
|
||||
chars = bytes.fromhex(m.group(1)).decode('latin-1')
|
||||
chars = bytes.fromhex(m.group(1)).decode('ascii', 'replace')
|
||||
if all(c.isalnum() or c in ' #' for c in chars):
|
||||
return repr(chars)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user