diff options
Diffstat (limited to 'pokemontools/preprocessor.py')
-rw-r--r-- | pokemontools/preprocessor.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/pokemontools/preprocessor.py b/pokemontools/preprocessor.py index 0b099d3..e33cda7 100644 --- a/pokemontools/preprocessor.py +++ b/pokemontools/preprocessor.py @@ -5,7 +5,7 @@ Basic preprocessor for both pokecrystal and pokered. import sys -from extras.pokemontools.crystal import ( +from crystal import ( DataByteWordMacro, ) @@ -515,7 +515,19 @@ def macro_translator(macro, token, line, skippable_macros, show_original_lines=F try: param_type = macro.param_types[index - correction] except KeyError as exception: - raise Exception("line is: " + str(line) + " and macro is: " + str(macro)) + raise Exception( + "Got a KeyError on param_types. This usually happens when a " \ + "macro should have been skipped but wasn't. But there are also " \ + "other sources of this error.\n\n" \ + "line is: {line}\n" \ + "macro is: {macro}\n" \ + "error is: {error}\n" + .format( + line=line, + macro=macro, + error=exception, + ) + ) description = param_type["name"] param_klass = param_type["class"] byte_type = param_klass.byte_type # db or dw |