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):
def subexpr_nodes(self):
# Extract a list of subexpression nodes based
# on the contents of the subexprs class attribute.
if self.saved_subexpr_nodes is None:
nodes = []
for name in self.subexprs:
item = getattr(self, name)
if item:
if isinstance(item, ExprNode):
nodes.append(item)
else:
nodes.extend(item)
self.saved_subexpr_nodes = nodes
return self.saved_subexpr_nodes
nodes = []
for name in self.subexprs:
item = getattr(self, name)
if item:
if isinstance(item, ExprNode):
nodes.append(item)
else:
nodes.extend(item)
return nodes
def result(self):
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