1.1 --- a/micropython/ast.py Mon Nov 10 23:57:05 2008 +0100
1.2 +++ b/micropython/ast.py Tue Dec 02 01:13:19 2008 +0100
1.3 @@ -128,6 +128,7 @@
1.4 self.new_op(Return())
1.5
1.6 self.unit.temp_usage = self.max_temp_position + 1
1.7 + self.unit.blocks = self.blocks
1.8 return self.blocks
1.9
1.10 def get_code(self, unit):
1.11 @@ -144,6 +145,7 @@
1.12 self.dispatch(unit.astnode)
1.13
1.14 self.unit.temp_usage = self.max_temp_position + 1
1.15 + self.unit.blocks = self.blocks
1.16 return self.blocks
1.17
1.18 def get_instantiator_code(self, cls):
1.19 @@ -183,6 +185,7 @@
1.20 self.new_op(StoreResult())
1.21 self.new_op(Return())
1.22
1.23 + self.unit.blocks = self.blocks
1.24 return self.blocks
1.25
1.26 # Allocation-related methods.
1.27 @@ -271,25 +274,6 @@
1.28 def drop_exception_blocks(self):
1.29 self.exception_blocks.pop()
1.30
1.31 - def new_label(self):
1.32 -
1.33 - "Return a new label object for use with set_label."
1.34 -
1.35 - number = self.label_number
1.36 - label = Label(number)
1.37 - self.labels[label] = label
1.38 - self.label_number += 1
1.39 - return label
1.40 -
1.41 - def set_label(self, label):
1.42 -
1.43 - """
1.44 - Set the location of 'label' to that within the entire image: the
1.45 - location within the code combined with location of the code unit.
1.46 - """
1.47 -
1.48 - label.location = len(self.code) + self.unit.code_location
1.49 -
1.50 # Assignment expression values.
1.51
1.52 def record_value(self, immediate=1):
1.53 @@ -1637,7 +1621,6 @@
1.54
1.55 unit = self.unit
1.56 self.unit = node.unit
1.57 - self.unit.code_location = self.module.code_location # class body code is not independently addressable
1.58 self.dispatch(node.code)
1.59 self.unit = unit
1.60