-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlisp_exceptions.py
32 lines (24 loc) · 963 Bytes
/
lisp_exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class LispException(Exception):
"""An exception caused by the Lisp interpreter"""
def __init__(self, func, msg):
self.msg, self.func = msg, func
def __str__(self):
return self.func + ": " + self.msg
class LispRuntimeException(LispException):
"""Runtime exception within interpreter"""
def __init__(self, func, msg):
self.msg, self.func = msg, func
def __str__(self):
return self.func + ": " + self.msg
class LispCompilationException(LispException):
"""Exception occuring during the compilation/preprocessing stage"""
def __init__(self, func, msg):
self.msg, self.func = msg, func
def __str__(self):
return self.func + ": " + self.msg
class LispParsingException(LispException):
"""Exception occuring during the parsing stage"""
def __init__(self, func, msg):
self.msg, self.func = msg, func
def __str__(self):
return self.func + ": " + self.msg