1.1 --- a/micropython/__init__.py Sun Mar 09 02:10:12 2008 +0100
1.2 +++ b/micropython/__init__.py Sun Mar 09 02:46:57 2008 +0100
1.3 @@ -100,11 +100,6 @@
1.4
1.5 pos = len(image)
1.6
1.7 - # Position the module in the image and make a translation.
1.8 -
1.9 - module.location = pos
1.10 - trans = micropython.ast.Translation(module, objtable, paramtable)
1.11 -
1.12 # Append constants to the image.
1.13
1.14 for const in module.constants():
1.15 @@ -112,6 +107,11 @@
1.16 image.append(const)
1.17 pos += 1
1.18
1.19 + # Position the module in the image and make a translation.
1.20 +
1.21 + module.location = pos
1.22 + trans = micropython.ast.Translation(module, objtable, paramtable)
1.23 +
1.24 # Add header details.
1.25
1.26 image.append(module)
1.27 @@ -126,12 +126,11 @@
1.28 # Append classes and functions to the image.
1.29
1.30 for obj in module.all_objects:
1.31 -
1.32 - # Fix the attributes.
1.33 + if isinstance(obj, micropython.inspect.Class):
1.34
1.35 - obj.finalise_attributes()
1.36 + # Fix the attributes.
1.37
1.38 - if isinstance(obj, micropython.inspect.Class):
1.39 + obj.finalise_attributes()
1.40
1.41 # Position the class in the image.
1.42
1.43 @@ -156,6 +155,10 @@
1.44
1.45 elif isinstance(obj, micropython.inspect.Function):
1.46
1.47 + # Fix the attributes.
1.48 +
1.49 + obj.finalise_attributes()
1.50 +
1.51 # Position the function in the image.
1.52
1.53 obj.location = pos