diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-11-30 10:01:33 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-11-30 10:01:33 -0600 |
commit | 44c3eb1ccf58d71344b7e6df8be71147eb1cf4c8 (patch) | |
tree | 9b7e4c6f7b9d36c0aa9005a313a76f6ea8d38718 /preprocessor.py | |
parent | 1e6f29557348eee31cdcf2bcaadbcd93dfe236bf (diff) |
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.
Diffstat (limited to 'preprocessor.py')
-rw-r--r-- | preprocessor.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/preprocessor.py b/preprocessor.py index f5e0b75ab..80622e2e2 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -559,8 +559,9 @@ def read_line(l): asm = l comment = None - # handle INCLUDE as a special case - if "INCLUDE \"" in asm: + # 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) |