mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
Fix types in pegen parser generator (GH-120720)
This commit is contained in:
parent
eaaf6995a8
commit
ace2045ea6
3 changed files with 6 additions and 6 deletions
|
|
@ -116,7 +116,7 @@ def visit_Rhs(self, node: Rhs) -> Tuple[Optional[str], str]:
|
|||
if len(node.alts) == 1 and len(node.alts[0].items) == 1:
|
||||
self.cache[node] = self.visit(node.alts[0].items[0])
|
||||
else:
|
||||
name = self.gen.artifical_rule_from_rhs(node)
|
||||
name = self.gen.artificial_rule_from_rhs(node)
|
||||
self.cache[node] = name, f"self.{name}()"
|
||||
return self.cache[node]
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ def visit_Repeat1(self, node: Repeat1) -> Tuple[str, str]:
|
|||
def visit_Gather(self, node: Gather) -> Tuple[str, str]:
|
||||
if node in self.cache:
|
||||
return self.cache[node]
|
||||
name = self.gen.artifical_rule_from_gather(node)
|
||||
name = self.gen.artificial_rule_from_gather(node)
|
||||
self.cache[node] = name, f"self.{name}()" # No trailing comma here either!
|
||||
return self.cache[node]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue