Commit 84ed66f4 authored by Stefan Behnel's avatar Stefan Behnel

Fix new visitchild() transform helper method.

parent 7f1347b1
# cython: language_level=3
# cython: language_level=3str
cimport cython
......
......@@ -279,10 +279,11 @@ class VisitorTransform(TreeVisitor):
def visitchild(self, parent, attr, idx=0):
# Helper to visit specific children from Python subclasses
child = getattr(parent, attr)
if attr is not None:
if child is not None:
node = self._visitchild(child, parent, attr, idx)
if node is not child:
setattr(parent, attr, node)
child = node
return child
def recurse_to_children(self, node):
......
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