We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c26bed1 commit a5cf286Copy full SHA for a5cf286
1 file changed
Tools/peg_generator/pegen/grammar.py
@@ -20,6 +20,10 @@ class GrammarVisitor:
20
def visit(self, node: Any, *args: Any, **kwargs: Any) -> Any:
21
"""Visit a node."""
22
method = "visit_" + node.__class__.__name__
23
+ if len(node.__class__.__name__) == 1:
24
+ method = "visit_single_" + node.__class__.__name__
25
+ elif len(node.__class__.__name__) > 1:
26
+ method = "visit_multi_" + node.__class__.__name__
27
visitor = getattr(self, method, self.generic_visit)
28
return visitor(node, *args, **kwargs)
29
0 commit comments