1.1 --- a/generator.py Sat Nov 19 18:38:27 2016 +0100
1.2 +++ b/generator.py Sat Nov 19 23:15:52 2016 +0100
1.3 @@ -256,16 +256,16 @@
1.4
1.5 # Generate function instances.
1.6
1.7 - functions = set()
1.8 -
1.9 - for ref in self.importer.objects.values():
1.10 - if ref.has_kind("<function>"):
1.11 - functions.add(ref.get_origin())
1.12 -
1.13 - functions = list(functions)
1.14 + functions = self.importer.function_parameters.keys()
1.15 functions.sort()
1.16
1.17 for path in functions:
1.18 +
1.19 + # Instantiators are generated above.
1.20 +
1.21 + if self.importer.classes.has_key(path) or not self.importer.get_object(path):
1.22 + continue
1.23 +
1.24 cls = self.function_type
1.25 table_name = encode_tablename("<instance>", cls)
1.26 structure_size = encode_size("<instance>", cls)
1.27 @@ -277,8 +277,8 @@
1.28
1.29 # Produce two structures where a method is involved.
1.30
1.31 - ref = self.importer.get_object(path)
1.32 - parent_ref = self.importer.get_object(ref.parent())
1.33 + parent, name = path.rsplit(".", 1)
1.34 + parent_ref = self.importer.get_object(parent)
1.35 parent_kind = parent_ref and parent_ref.get_kind()
1.36
1.37 # Populate and write each structure.