1.1 --- a/micropython/ast.py Fri Dec 12 00:59:44 2008 +0100
1.2 +++ b/micropython/ast.py Fri Jan 16 00:52:04 2009 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Translate the AST of a Python program into a more interpretable representation.
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 @@ -42,11 +42,11 @@
1.13 name_load_instructions = (LoadName, LoadAddress)
1.14 name_store_instructions = (StoreName, StoreAddress)
1.15
1.16 - def __init__(self, module, importer):
1.17 + def __init__(self, module, program):
1.18
1.19 """
1.20 - Initialise the translation with an inspected 'module' and the module
1.21 - 'importer'.
1.22 + Initialise the translation with an inspected 'module' and the 'program'
1.23 + container.
1.24 """
1.25
1.26 ASTVisitor.__init__(self)
1.27 @@ -55,14 +55,15 @@
1.28
1.29 # Global program dependencies.
1.30
1.31 - self.importer = importer
1.32 - self.objtable = self.importer.get_object_table()
1.33 - self.paramtable = self.importer.get_parameter_table()
1.34 + self.program = program
1.35 + self.objtable = self.program.get_object_table()
1.36 + self.paramtable = self.program.get_parameter_table()
1.37 + self.importer = self.program.get_importer()
1.38 self.builtins = self.importer.modules.get("__builtins__")
1.39
1.40 # Optimisation.
1.41
1.42 - self.optimiser = Optimiser(self, importer.optimisations)
1.43 + self.optimiser = Optimiser(self, program.optimisations)
1.44
1.45 # The current unit being translated.
1.46