mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
clean up formatting in preprocessor
This commit is contained in:
parent
a1a9fa5560
commit
9b4718d0c7
@ -180,7 +180,6 @@ chars = {
|
|||||||
"ょ": 0xE2,
|
"ょ": 0xE2,
|
||||||
"ー": 0xE3,
|
"ー": 0xE3,
|
||||||
|
|
||||||
|
|
||||||
"@": 0x50,
|
"@": 0x50,
|
||||||
"#": 0x54,
|
"#": 0x54,
|
||||||
"…": 0x75,
|
"…": 0x75,
|
||||||
@ -331,7 +330,7 @@ def quote_translator(asm):
|
|||||||
|
|
||||||
# skip asm that actually does use ASCII in quotes
|
# skip asm that actually does use ASCII in quotes
|
||||||
lowasm = asms[0].lower()
|
lowasm = asms[0].lower()
|
||||||
|
|
||||||
if "section" in lowasm \
|
if "section" in lowasm \
|
||||||
or "incbin" in lowasm:
|
or "incbin" in lowasm:
|
||||||
sys.stdout.write(asm)
|
sys.stdout.write(asm)
|
||||||
@ -442,7 +441,6 @@ def macro_translator(macro, token, line):
|
|||||||
# write out a comment showing the original line
|
# write out a comment showing the original line
|
||||||
sys.stdout.write("; original_line: " + original_line)
|
sys.stdout.write("; original_line: " + original_line)
|
||||||
|
|
||||||
|
|
||||||
# "db" is a macro because of TextEndingCommand
|
# "db" is a macro because of TextEndingCommand
|
||||||
# rgbasm can handle "db" so no preprocessing is required
|
# rgbasm can handle "db" so no preprocessing is required
|
||||||
# (don't check its param count)
|
# (don't check its param count)
|
||||||
@ -545,7 +543,6 @@ def macro_translator(macro, token, line):
|
|||||||
|
|
||||||
index += 1
|
index += 1
|
||||||
|
|
||||||
|
|
||||||
def include_file(asm):
|
def include_file(asm):
|
||||||
filename = asm.split("\"")
|
filename = asm.split("\"")
|
||||||
filename = filename[1].replace("\"","").replace("\n","")
|
filename = filename[1].replace("\"","").replace("\n","")
|
||||||
@ -560,24 +557,23 @@ def read_line(l):
|
|||||||
else:
|
else:
|
||||||
asm = l
|
asm = l
|
||||||
comment = None
|
comment = None
|
||||||
|
|
||||||
if "INCLUDE \"" in asm:
|
if "INCLUDE \"" in asm:
|
||||||
include_file(asm)
|
include_file(asm)
|
||||||
|
|
||||||
elif "\"" in asm:
|
elif "\"" in asm:
|
||||||
# convert text to bytes when a quote appears (not in a comment)
|
# convert text to bytes when a quote appears (not in a comment)
|
||||||
quote_translator(asm)
|
quote_translator(asm)
|
||||||
|
|
||||||
|
|
||||||
# check against other preprocessor features
|
# check against other preprocessor features
|
||||||
else:
|
else:
|
||||||
macro, token = macro_test(asm)
|
macro, token = macro_test(asm)
|
||||||
|
|
||||||
if macro:
|
if macro:
|
||||||
macro_translator(macro, token, asm)
|
macro_translator(macro, token, asm)
|
||||||
else:
|
else:
|
||||||
sys.stdout.write(asm)
|
sys.stdout.write(asm)
|
||||||
|
|
||||||
# show line comment
|
# show line comment
|
||||||
if comment != None:
|
if comment != None:
|
||||||
sys.stdout.write(comment)
|
sys.stdout.write(comment)
|
||||||
|
Loading…
Reference in New Issue
Block a user