]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-138257: Fix internal `RuleCollectorVisitor` attribute name (GH-138208)...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 30 Aug 2025 09:51:25 +0000 (11:51 +0200)
committerGitHub <noreply@github.com>
Sat, 30 Aug 2025 09:51:25 +0000 (09:51 +0000)
gh-138257: Fix internal `RuleCollectorVisitor` attribute name (GH-138208)

The internal `RuleCollectorVisitor` class had an attribute named "rulses"
instead of "rules" that other `GrammarVisitor` subclasses define.
(cherry picked from commit 11217a883da324b85a290f5d78f090d8f4880f16)

Co-authored-by: chemelnucfin <3982092+chemelnucfin@users.noreply.github.com>
Tools/peg_generator/pegen/parser_generator.py

index a2f1c08330f713461fb103a49541bcbe3be4dac0..9862b619424964ab582cfc51782b811223231dad 100644 (file)
@@ -44,7 +44,7 @@ class RuleCollectorVisitor(GrammarVisitor):
     """Visitor that invokes a provieded callmaker visitor with just the NamedItem nodes"""
 
     def __init__(self, rules: Dict[str, Rule], callmakervisitor: GrammarVisitor) -> None:
-        self.rulses = rules
+        self.rules = rules
         self.callmaker = callmakervisitor
 
     def visit_Rule(self, rule: Rule) -> None: