Commit 4ff586a3 authored by Stefan Behnel's avatar Stefan Behnel

removed caching for subexpr attributes as it can break tree manipulation

parent 678b2296
...@@ -196,17 +196,15 @@ class ExprNode(Node): ...@@ -196,17 +196,15 @@ class ExprNode(Node):
def subexpr_nodes(self): def subexpr_nodes(self):
# Extract a list of subexpression nodes based # Extract a list of subexpression nodes based
# on the contents of the subexprs class attribute. # on the contents of the subexprs class attribute.
if self.saved_subexpr_nodes is None: nodes = []
nodes = [] for name in self.subexprs:
for name in self.subexprs: item = getattr(self, name)
item = getattr(self, name) if item:
if item: if isinstance(item, ExprNode):
if isinstance(item, ExprNode): nodes.append(item)
nodes.append(item) else:
else: nodes.extend(item)
nodes.extend(item) return nodes
self.saved_subexpr_nodes = nodes
return self.saved_subexpr_nodes
def result(self): def result(self):
if not self.is_temp or self.is_target: if not self.is_temp or self.is_target:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment