Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
yf-yang committed Jun 13, 2024
1 parent 3cefc85 commit 702b0e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/pegen/parser_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def collect_todo(self) -> None:
self.todo[rulename].collect_todo(self)
done = set(alltodo)

def artifical_rule_from_rhs(self, rhs: Rhs) -> str:
def artificial_rule_from_rhs(self, rhs: Rhs) -> str:
self.counter += 1
name = f"_tmp_{self.counter}" # TODO: Pick a nicer name.
self.todo[name] = Rule(name, None, rhs)
Expand All @@ -129,7 +129,7 @@ def artificial_rule_from_repeat(self, node: Plain, is_repeat1: bool) -> str:
self.todo[name] = Rule(name, None, Rhs([Alt([NamedItem(None, node)])]))
return name

def artifical_rule_from_gather(self, node: Gather) -> str:
def artificial_rule_from_gather(self, node: Gather) -> str:
self.counter += 1
name = f"_gather_{self.counter}"
self.counter += 1
Expand Down
4 changes: 2 additions & 2 deletions src/pegen/python_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,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]

Expand Down Expand Up @@ -186,7 +186,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]

Expand Down

0 comments on commit 702b0e8

Please sign in to comment.