make the include macro check better

The include macro is now checked against only the beginning of the line,
and comments in the asm file can say "INCLUDE \"" if they need to. In
addition, the preprocessor now supports INCLUDE lines that are preceded
by a tab character. However, if this included file has multiple lines,
the output will not be automatically aligned with the initial tab. This
might cause problems with rgbasm.
This commit is contained in:
Bryan Bishop 2012-11-30 10:01:33 -06:00
parent 1e6f295573
commit 44c3eb1ccf
1 changed files with 3 additions and 2 deletions

View File

@ -559,8 +559,9 @@ def read_line(l):
asm = l asm = l
comment = None comment = None
# handle INCLUDE as a special case # handle INCLUDE as a special case either at the start of the line or
if "INCLUDE \"" in asm: # after the first character in the line (like a tab)
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)