MCPcopy Index your code
hub / github.com/evalplus/evalplus / traverse_tree

Function traverse_tree

evalplus/sanitize.py:83–99  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

81
82
83def traverse_tree(node: Node) -> Generator[Node, None, None]:
84 cursor = node.walk()
85 depth = 0
86
87 visited_children = False
88 while True:
89 if not visited_children:
90 yield cursor.node
91 if not cursor.goto_first_child():
92 depth += 1
93 visited_children = True
94 elif cursor.goto_next_sibling():
95 visited_children = False
96 elif not cursor.goto_parent() or depth == 0:
97 break
98 else:
99 depth -= 1
100
101
102def has_return_statement(node: Node) -> bool:

Callers 1

has_return_statementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected