Skip to content

Commit

Permalink
Use shorter name of Iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Aug 18, 2023
1 parent 9b13d6b commit 5b3732d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Tools/cases_generator/formatting.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import collections
import contextlib
import re
import typing
from collections.abc import Iterator

from parsing import StackEffect, Family

Expand Down Expand Up @@ -59,13 +59,13 @@ def reset_lineno(self) -> None:
self.set_lineno(self.lineno + 1, self.filename)

@contextlib.contextmanager
def indent(self) -> collections.abc.Iterator[None]:
def indent(self) -> Iterator[None]:
self.prefix += " "
yield
self.prefix = self.prefix[:-4]

@contextlib.contextmanager
def block(self, head: str, tail: str = "") -> collections.abc.Iterator[None]:
def block(self, head: str, tail: str = "") -> Iterator[None]:
if head:
self.emit(head + " {")
else:
Expand Down
6 changes: 2 additions & 4 deletions Tools/cases_generator/generate_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"""

import argparse
import collections
import contextlib
import itertools
import os
import posixpath
import sys
import typing
from collections.abc import Iterator

import stacking # Early import to avoid circular import
from analysis import Analyzer
Expand Down Expand Up @@ -193,9 +193,7 @@ def effect_str(effects: list[StackEffect]) -> str:
return instr, popped, pushed

@contextlib.contextmanager
def metadata_item(
self, signature: str, open: str, close: str
) -> collections.abc.Iterator[None]:
def metadata_item(self, signature: str, open: str, close: str) -> Iterator[None]:
self.out.emit("")
self.out.emit(f"extern {signature};")
self.out.emit("#ifdef NEED_OPCODE_METADATA")
Expand Down

0 comments on commit 5b3732d

Please sign in to comment.