You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
allow labels and includes on the same line
This commit is contained in:
@@ -569,13 +569,19 @@ def macro_translator(macro, token, line):
|
|||||||
def include_file(asm):
|
def include_file(asm):
|
||||||
"""This is more reliable than rgbasm/rgbds including files on its own."""
|
"""This is more reliable than rgbasm/rgbds including files on its own."""
|
||||||
|
|
||||||
|
prefix = asm.split("INCLUDE \"")[0] + '\n'
|
||||||
filename = asm.split("\"")[1]
|
filename = asm.split("\"")[1]
|
||||||
|
suffix = asm.split("\"")[2]
|
||||||
|
|
||||||
|
read_line(prefix)
|
||||||
|
|
||||||
lines = open(filename, "r").readlines()
|
lines = open(filename, "r").readlines()
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
read_line(line)
|
read_line(line)
|
||||||
|
|
||||||
|
read_line(suffix)
|
||||||
|
|
||||||
def read_line(l):
|
def read_line(l):
|
||||||
"""Preprocesses a given line of asm."""
|
"""Preprocesses a given line of asm."""
|
||||||
|
|
||||||
@@ -586,9 +592,8 @@ def read_line(l):
|
|||||||
asm = l
|
asm = l
|
||||||
comment = None
|
comment = None
|
||||||
|
|
||||||
# handle INCLUDE as a special case either at the start of the line or
|
# handle INCLUDE as a special case
|
||||||
# after the first character in the line (like a tab)
|
if "INCLUDE \"" in l:
|
||||||
if "INCLUDE \"" in [asm[0:9], asm[1:9]]:
|
|
||||||
include_file(asm)
|
include_file(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)
|
||||||
|
Reference in New Issue
Block a user