1.1 --- a/micropython/rsvp.py Thu Jan 13 23:58:12 2011 +0100
1.2 +++ b/micropython/rsvp.py Sat Jan 29 21:07:27 2011 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 RSVP instruction and serialisation classes.
1.6
1.7 -Copyright (C) 2007, 2008, 2009, 2010 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2007, 2008, 2009, 2010, 2011 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 @@ -20,7 +20,7 @@
1.13 """
1.14
1.15 from micropython.data import Attr, Const, Class, Function, Module
1.16 -from micropython.program import Block, DataObject, DataValue
1.17 +from micropython.program import Block, DataObject, DataValue, PlaceholderContext
1.18 from micropython.raw import RawObject
1.19
1.20 def name(attr):
1.21 @@ -82,7 +82,10 @@
1.22
1.23 def set_location(self, location, with_builtins):
1.24 self.item.instance_template_location = location
1.25 - return RSVPObject.set_location(self, location + 1, with_builtins)
1.26 +
1.27 + # Include the instance template and __class__ attribute in the size.
1.28 +
1.29 + return RSVPObject.set_location(self, location + 2, with_builtins)
1.30
1.31 def finalise_location(self, with_builtins):
1.32 self._finalise_location(with_builtins)
1.33 @@ -121,6 +124,13 @@
1.34 call_method_funccode # funccode
1.35 ),
1.36
1.37 + # The __class__ attribute for instances.
1.38 +
1.39 + DataValue(
1.40 + PlaceholderContext,
1.41 + item.location
1.42 + ),
1.43 +
1.44 # Class...
1.45
1.46 DataObject(