shithub: pokecrystal

Download patch

ref: 1ce2bccd3747f5c311f40389fa3895e29dfae21b
parent: a6237d68257dd3bb963850c205d0ca4a1c46f88a
author: Bryan Bishop <[email protected]>
date: Sat Aug 31 05:45:12 EDT 2013

generic preprocessor-specific exception classes

These are basic python Exception subclasses that can be used to throw
more specific errors and exceptions from within the preprocessor.

AssertionError is not a good idea.

--- a/preprocessor.py
+++ b/preprocessor.py
@@ -302,6 +302,16 @@
 "9": 0xFF
 }
 
+class PreprocessorException(Exception):
+    """
+    There was a problem in the preprocessor.
+    """
+
+class MacroException(PreprocessorException):
+    """
+    There was a problem with a macro.
+    """
+
 def separate_comment(l):
     """
     Separates asm and comments on a single line.