1.1 --- a/rsvp.py Sat Jan 24 02:41:59 2009 +0100
1.2 +++ b/rsvp.py Sun Jan 25 02:56:16 2009 +0100
1.3 @@ -5,7 +5,7 @@
1.4 ignore low-level operations and merely concentrate on variable access, structure
1.5 access, structure allocation and function invocations.
1.6
1.7 -Copyright (C) 2007, 2008 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2007, 2008, 2009 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -56,7 +56,12 @@
1.13 pass
1.14
1.15 class IllegalAddress(Exception):
1.16 - pass
1.17 + def __init__(self, address):
1.18 + self.address = address
1.19 + def __repr__(self):
1.20 + return "IllegalAddress(%r)" % self.address
1.21 + def __str__(self):
1.22 + return repr(self)
1.23
1.24 class EmptyPCStack(Exception):
1.25 pass
1.26 @@ -161,7 +166,9 @@
1.27 try:
1.28 return self.memory[address]
1.29 except IndexError:
1.30 - raise IllegalAddress, address
1.31 + raise IllegalAddress(address)
1.32 + except TypeError:
1.33 + raise IllegalAddress(address)
1.34
1.35 def save(self, address, value):
1.36
1.37 @@ -170,7 +177,9 @@
1.38 try:
1.39 self.memory[address] = value
1.40 except IndexError:
1.41 - raise IllegalAddress, address
1.42 + raise IllegalAddress(address)
1.43 + except TypeError:
1.44 + raise IllegalAddress(address)
1.45
1.46 def new(self, size):
1.47