From 1ce2bccd3747f5c311f40389fa3895e29dfae21b Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Sat, 31 Aug 2013 09:45:12 -0500 Subject: 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. --- preprocessor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'preprocessor.py') diff --git a/preprocessor.py b/preprocessor.py index b6bdfbe7d..69121747d 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -302,6 +302,16 @@ chars = { "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. -- cgit v1.2.3