MCPcopy Create free account
hub / github.com/python/cpython / visit

Method visit

Tools/peg_generator/pegen/grammar.py:12–16  ·  view source on GitHub ↗

Visit a node.

(self, node: Any, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

10
11class GrammarVisitor:
12 def visit(self, node: Any, *args: Any, **kwargs: Any) -> Any:
13 """Visit a node."""
14 method = "visit_" + node.__class__.__name__
15 visitor = getattr(self, method, self.generic_visit)
16 return visitor(node, *args, **kwargs)
17
18 def generic_visit(self, node: Iterable[Any], *args: Any, **kwargs: Any) -> Any:
19 """Called if no explicit visitor function exists for a node."""

Callers 1

generic_visitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected