mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-01-23 09:16:20 -08:00
update spacing for read_line in preprocessor
This commit is contained in:
parent
44c3eb1ccf
commit
935384f931
@ -552,34 +552,34 @@ def include_file(asm):
|
|||||||
read_line(line)
|
read_line(line)
|
||||||
|
|
||||||
def read_line(l):
|
def read_line(l):
|
||||||
# strip and store any comment on this line
|
# strip and store any comment on this line
|
||||||
if ";" in l:
|
if ";" in l:
|
||||||
asm, comment = separate_comment(l)
|
asm, comment = separate_comment(l)
|
||||||
|
else:
|
||||||
|
asm = l
|
||||||
|
comment = None
|
||||||
|
|
||||||
|
# handle INCLUDE as a special case either at the start of the line or
|
||||||
|
# after the first character in the line (like a tab)
|
||||||
|
if "INCLUDE \"" in [asm[0:9], asm[1:9]]:
|
||||||
|
include_file(asm)
|
||||||
|
|
||||||
|
# convert text to bytes when a quote appears (not in a comment)
|
||||||
|
elif "\"" in asm:
|
||||||
|
quote_translator(asm)
|
||||||
|
|
||||||
|
# check against other preprocessor features
|
||||||
|
else:
|
||||||
|
macro, token = macro_test(asm)
|
||||||
|
|
||||||
|
if macro:
|
||||||
|
macro_translator(macro, token, asm)
|
||||||
else:
|
else:
|
||||||
asm = l
|
sys.stdout.write(asm)
|
||||||
comment = None
|
|
||||||
|
|
||||||
# handle INCLUDE as a special case either at the start of the line or
|
# show line comment
|
||||||
# after the first character in the line (like a tab)
|
if comment != None:
|
||||||
if "INCLUDE \"" in [asm[0:9], asm[1:9]]:
|
sys.stdout.write(comment)
|
||||||
include_file(asm)
|
|
||||||
|
|
||||||
# convert text to bytes when a quote appears (not in a comment)
|
|
||||||
elif "\"" in asm:
|
|
||||||
quote_translator(asm)
|
|
||||||
|
|
||||||
# check against other preprocessor features
|
|
||||||
else:
|
|
||||||
macro, token = macro_test(asm)
|
|
||||||
|
|
||||||
if macro:
|
|
||||||
macro_translator(macro, token, asm)
|
|
||||||
else:
|
|
||||||
sys.stdout.write(asm)
|
|
||||||
|
|
||||||
# show line comment
|
|
||||||
if comment != None:
|
|
||||||
sys.stdout.write(comment)
|
|
||||||
|
|
||||||
for l in sys.stdin:
|
for l in sys.stdin:
|
||||||
read_line(l)
|
read_line(l)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user