1.1 --- a/micropython/ast.py Mon Jul 13 01:02:42 2009 +0200
1.2 +++ b/micropython/ast.py Tue Jul 14 00:37:04 2009 +0200
1.3 @@ -421,9 +421,15 @@
1.4 def visitListCompIf(self, node): raise TranslationNotImplementedError(self.module.full_name(), node, "ListCompIf")
1.5
1.6 def visitName(self, node):
1.7 +
1.8 + # Handle names referring to constants.
1.9 +
1.10 if self.importer.predefined_constants.has_key(node.name):
1.11 const = self.importer.get_predefined_constant(node.name)
1.12 self.new_op(LoadConst(const))
1.13 +
1.14 + # Handle all other names.
1.15 +
1.16 else:
1.17 self._visitName(node, self.name_load_instructions)
1.18
1.19 @@ -606,6 +612,13 @@
1.20
1.21 self.set_block(fn.body_block)
1.22
1.23 + # For functions with star parameters, make a special list for the
1.24 + # extra arguments and re-map the parameter.
1.25 +
1.26 + if fn.has_star:
1.27 + self.new_op(CopyExtra(nparams))
1.28 + self.new_op(StoreName(nparams - 1))
1.29 +
1.30 extend = ExtendFrame()
1.31 self.new_op(extend)
1.32