1.1 --- a/simplify.py Sun Oct 29 21:25:08 2006 +0100
1.2 +++ b/simplify.py Sun Oct 29 22:47:42 2006 +0100
1.3 @@ -73,6 +73,7 @@
1.4 self.structures = [] # Structures/classes.
1.5 self.constants = {} # Constants.
1.6 self.current_subprograms = [] # Current subprograms being processed.
1.7 + self.current_structures = [] # Current structures being processed.
1.8 self.builtins = builtins # Whether the builtins are being processed.
1.9
1.10 # Convenience attributes.
1.11 @@ -1026,11 +1027,13 @@
1.12
1.13 subprogram = Subprogram(name=None, module=self.module, structure=structure, params=[], star=None, dstar=None)
1.14 self.current_subprograms.append(subprogram)
1.15 + self.current_structures.append(structure) # mostly for name construction
1.16
1.17 # The class is initialised using the code found inside.
1.18
1.19 subprogram.code = self.dispatch(class_.code) + [Return()]
1.20
1.21 + self.current_structures.pop()
1.22 self.current_subprograms.pop()
1.23 self.subprograms.append(subprogram); self.subnames[subprogram.full_name()] = subprogram
1.24
1.25 @@ -1120,7 +1123,9 @@
1.26 (dstar)
1.27 """
1.28
1.29 - subprogram = Subprogram(name=function.name, module=self.module, internal=0, returns_value=1, star=None, dstar=None)
1.30 + subprogram = Subprogram(name=function.name, module=self.module, structures=self.current_structures[:],
1.31 + internal=0, returns_value=1, star=None, dstar=None)
1.32 +
1.33 self.current_subprograms.append(subprogram)
1.34 subprogram.code = self.dispatch(function.code) + [Return()]
1.35 self.current_subprograms.pop()
2.1 --- a/viewer.py Sun Oct 29 21:25:08 2006 +0100
2.2 +++ b/viewer.py Sun Oct 29 22:47:42 2006 +0100
2.3 @@ -337,7 +337,7 @@
2.4 self._popup_start()
2.5 self._invocations(conditional.test)
2.6 self._popup_end()
2.7 - self.stream.write("<span>\n")
2.8 + self.stream.write("</span>\n")
2.9 self.dispatch(compare)
2.10 self.stream.write(":\n")
2.11 self.stream.write("</div>\n")
2.12 @@ -440,7 +440,12 @@
2.13 def visitWhile(self, node):
2.14 self.stream.write("<div class='while'>\n")
2.15 self.stream.write("<div>\n")
2.16 + self.stream.write("<span class='conditional'>\n")
2.17 self._keyword("while")
2.18 + self._popup_start()
2.19 + self._invocations(node.test)
2.20 + self._popup_end()
2.21 + self.stream.write("</span>\n")
2.22 self.dispatch(node.test)
2.23 self.stream.write(":\n")
2.24 self.stream.write("</div>\n")
2.25 @@ -706,9 +711,10 @@
2.26 fn = invocation.full_name()
2.27 module = invocation.module.name
2.28 name = invocation.name
2.29 + structures = [x.name for x in invocation.structures]
2.30 self.stream.write("<div class='invocation'>")
2.31 self.stream.write("<a href='%s.html#%s'>" % (self._url(module), self._url(fn)))
2.32 - self.stream.write("%s.%s" % (self._text(module), self._text(name)))
2.33 + self.stream.write(self._text(".".join([module] + structures + [name])))
2.34 self.stream.write("</a>")
2.35 self.stream.write("</div>\n")
2.36 self.stream.write("</div>\n")