# HG changeset patch # User paulb@localhost.localdomain # Date 1170719785 -3600 # Node ID f883eee9485233a51ef8ce9f2bf56f5f1652a982 # Parent bb09a8becf0160d672b6086203f7d56b010f10c2 Made functions and lambdas use "defining" Subprogram nodes. Changed _nodes construction to only use "defining" nodes. diff -r bb09a8becf01 -r f883eee94852 simplified.py --- a/simplified.py Fri Jan 26 01:26:28 2007 +0100 +++ b/simplified.py Tue Feb 06 00:56:25 2007 +0100 @@ -309,7 +309,7 @@ # Add links to copied nodes from original AST nodes. - if node.original is not None: + if node.original is not None and node.defining: if not hasattr(node.original, "_nodes"): node.original._nodes = [] node.original._nodes.append(node) diff -r bb09a8becf01 -r f883eee94852 simplify.py --- a/simplify.py Fri Jan 26 01:26:28 2007 +0100 +++ b/simplify.py Tue Feb 06 00:56:25 2007 +0100 @@ -833,7 +833,9 @@ (dstar) """ - subprogram = Subprogram(name=function.name, module=self.module, structures=self.current_structures[:], + # NOTE: Making the actual subprogram defining, too. + + subprogram = Subprogram(function, 1, name=function.name, module=self.module, structures=self.current_structures[:], internal=0, returns_value=1, star=None, dstar=None, is_method=self.within_class, original_def=function) self.current_subprograms.append(subprogram) @@ -945,8 +947,9 @@ # Make a subprogram for the function and record it outside the main # tree. + # NOTE: Making the actual subprogram defining, too. - subprogram = Subprogram(name=None, module=self.module, internal=0, returns_value=1, star=None, dstar=None, original_def=lambda_) + subprogram = Subprogram(lambda_, 1, name=None, module=self.module, internal=0, returns_value=1, star=None, dstar=None, original_def=lambda_) self.current_subprograms.append(subprogram) subprogram.code = [ReturnFromFunction(expr=self.dispatch(lambda_.code))] self.current_subprograms.pop()