1.1 --- a/micropython/rsvp.py Sat Jun 30 00:15:09 2012 +0200
1.2 +++ b/micropython/rsvp.py Sat Jun 30 17:06:37 2012 +0200
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, 2011 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 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 @@ -87,7 +87,7 @@
1.13
1.14 return RSVPObject.set_location(self, location + 1, objtable, with_builtins)
1.15
1.16 - def finalise_location(self, with_builtins):
1.17 + def finalise_body_location(self, with_builtins):
1.18 self._finalise_location(with_builtins)
1.19
1.20 def as_raw(self, objtable, paramtable, with_builtins):
1.21 @@ -235,7 +235,7 @@
1.22
1.23 return location
1.24
1.25 - def finalise_location(self, with_builtins):
1.26 + def finalise_body_location(self, with_builtins):
1.27 self._finalise_location(with_builtins)
1.28
1.29 def as_raw(self, objtable, paramtable, with_builtins):
1.30 @@ -256,13 +256,18 @@
1.31
1.32 "A wrapper for modules."
1.33
1.34 + def finalise_location(self, with_builtins):
1.35 + item = self.item
1.36 + if item.blocks:
1.37 + item.code_location = item.blocks[0].location
1.38 +
1.39 def as_raw(self, objtable, paramtable, with_builtins):
1.40 item = self.item
1.41 return [
1.42 DataObject(
1.43 objtable.as_list().get_code(item.full_name()),
1.44 None, # modules treated like classes
1.45 - None,
1.46 + item.code_location,
1.47 item.full_name(),
1.48 len(item.module_attributes()) + 1 # size
1.49 )
1.50 @@ -409,7 +414,7 @@
1.51
1.52 class TargetInstruction(Instruction):
1.53
1.54 - "An instruction loading the address of an invocation target."
1.55 + "An instruction loading the address of a direct invocation target."
1.56
1.57 def format_operand(self):
1.58 return Instruction.format_operand(self) + ["name=%r" % name(self.attr)]