1.1 --- a/translator.py Thu Feb 09 00:37:28 2017 +0100
1.2 +++ b/translator.py Thu Feb 09 15:36:02 2017 +0100
1.3 @@ -1476,6 +1476,11 @@
1.4 ref, paths = self.importer.get_module(self.name).special[n.name]
1.5 return TrResolvedNameRef(n.name, ref)
1.6
1.7 + # Temporary names are output program locals.
1.8 +
1.9 + elif n.name.startswith("$t"):
1.10 + return TrResolvedNameRef(n.name, Reference("<var>"), expr=expr)
1.11 +
1.12 # Get the appropriate name for the name reference, using the same method
1.13 # as in the inspector.
1.14
1.15 @@ -1827,6 +1832,19 @@
1.16 print >>self.out, "void __main_%s()" % encode_path(self.name)
1.17 print >>self.out, "{"
1.18 self.indent += 1
1.19 +
1.20 + # Define temporary variables, excluded from the module structure itself.
1.21 +
1.22 + tempnames = []
1.23 +
1.24 + for n in self.importer.all_module_attrs[self.name]:
1.25 + if n.startswith("$t"):
1.26 + tempnames.append(encode_path(n))
1.27 +
1.28 + if tempnames:
1.29 + tempnames.sort()
1.30 + self.writeline("__attr %s;" % ", ".join(tempnames))
1.31 +
1.32 self.start_unit()
1.33
1.34 def end_module(self):