MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / traverse

Method traverse

tests/test_ast_pattern_matching.py:19–32  ·  view source on GitHub ↗
(self, initial_node)

Source from the content-addressed store, hash-verified

17 self.path = self.normalized_path
18
19 def traverse(self, initial_node):
20 self.q.clear()
21 self.q.append(Context(node=initial_node, parent=None, visitor=self))
22
23 while len(self.q):
24 ctx = self.q.popleft()
25 if self.p.match(ctx.node):
26 self.p.apply(ctx)
27 return ctx.node
28
29 if isinstance(ctx.node, ASTNode):
30 ctx.node._visit_node(ctx)
31
32 return False
33
34 def push(self, ctx):
35 self.q.append(ctx)

Callers 4

test_patternsFunction · 0.95
test_matching_triggersFunction · 0.95
test_any_ofFunction · 0.95
disabled_test_decoratorFunction · 0.95

Calls 4

ContextClass · 0.90
applyMethod · 0.80
matchMethod · 0.45
_visit_nodeMethod · 0.45

Tested by

no test coverage detected