1.1 --- a/translator.py Mon Jan 08 00:13:18 2018 +0100
1.2 +++ b/translator.py Mon Jan 08 00:30:23 2018 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Translate programs.
1.6
1.7 -Copyright (C) 2015, 2016, 2017, 2018 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2015, 2016, 2017 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 @@ -854,6 +854,15 @@
1.13 if self.in_method():
1.14 self.generate_guard("self")
1.15
1.16 + # Make assignments for .name entries in the parameters, provided this is
1.17 + # a method.
1.18 +
1.19 + if self.in_method():
1.20 + for name in self.importer.function_attr_initialisers.get(function_name) or []:
1.21 + self.process_assignment_node(
1.22 + compiler.ast.AssAttr(compiler.ast.Name("self"), name, "OP_ASSIGN"),
1.23 + compiler.ast.Name(name))
1.24 +
1.25 # Produce the body and any additional return statement.
1.26
1.27 expr = self.process_structure_node(n.code) or \