diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-08-31 08:11:08 -0700 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-08-31 08:11:08 -0700 |
commit | 5118fb757879f7ccf177b7d84582d85c6dd5d14c (patch) | |
tree | 48e55c041f965bb380dfa0885b5e75a7b816fe4f /preprocessor.py | |
parent | 63c2dc2f1ffb3ec93f8fb6b97b0b909c36ecc0bf (diff) | |
parent | 998fa0b198c19088189634920b2c9829a5324576 (diff) |
Merge pull request #181 from kanzure/remove-globals-from-preprocessor
Remove globals from preprocessor.
Diffstat (limited to 'preprocessor.py')
-rw-r--r-- | preprocessor.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/preprocessor.py b/preprocessor.py index b6bdfbe7d..ae9b5624b 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -31,12 +31,6 @@ macros += movement_command_classes macros += music_classes macros += effect_classes -# show lines before preprocessing in stdout -show_original_lines = False - -# helpful for debugging macros -do_macro_sanity_check = False - chars = { "ガ": 0x05, "ギ": 0x06, @@ -434,11 +428,13 @@ def is_based_on(something, base): options += [something.__name__] return (base in options) -def macro_translator(macro, token, line): +def macro_translator(macro, token, line, show_original_lines=False, do_macro_sanity_check=False): """ Converts a line with a macro into a rgbasm-compatible line. - """ + @param show_original_lines: show lines before preprocessing in stdout + @param do_macro_sanity_check: helpful for debugging macros + """ assert macro.macro_name == token, "macro/token mismatch" original_line = line |