Big diff: use lower-case list and dict (#5888)

This commit is contained in:
Akuli
2021-08-08 19:26:35 +03:00
committed by GitHub
parent 11f54c3407
commit ce11072dbe
325 changed files with 2196 additions and 2334 deletions

View File

@@ -16,7 +16,7 @@ class Base:
type: int
parent: Node | None
prefix: str
children: List[_NL]
children: list[_NL]
was_changed: bool
was_checked: bool
def __eq__(self, other: Any) -> bool: ...
@@ -24,7 +24,7 @@ class Base:
def clone(self: _P) -> _P: ...
def post_order(self) -> Iterator[_NL]: ...
def pre_order(self) -> Iterator[_NL]: ...
def replace(self, new: _NL | List[_NL]) -> None: ...
def replace(self, new: _NL | list[_NL]) -> None: ...
def get_lineno(self) -> int: ...
def changed(self) -> None: ...
def remove(self) -> int | None: ...
@@ -37,14 +37,14 @@ class Base:
def get_suffix(self) -> str: ...
class Node(Base):
fixers_applied: List[Any]
fixers_applied: list[Any]
def __init__(
self,
type: int,
children: List[_NL],
children: list[_NL],
context: Any | None = ...,
prefix: str | None = ...,
fixers_applied: List[Any] | None = ...,
fixers_applied: list[Any] | None = ...,
) -> None: ...
def set_child(self, i: int, child: _NL) -> None: ...
def insert_child(self, i: int, child: _NL) -> None: ...
@@ -54,9 +54,9 @@ class Leaf(Base):
lineno: int
column: int
value: str
fixers_applied: List[Any]
fixers_applied: list[Any]
def __init__(
self, type: int, value: str, context: _Context | None = ..., prefix: str | None = ..., fixers_applied: List[Any] = ...
self, type: int, value: str, context: _Context | None = ..., prefix: str | None = ..., fixers_applied: list[Any] = ...
) -> None: ...
def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ...
@@ -67,8 +67,8 @@ class BasePattern:
name: str | None
def optimize(self) -> BasePattern: ... # sic, subclasses are free to optimize themselves into different patterns
def match(self, node: _NL, results: _Results | None = ...) -> bool: ...
def match_seq(self, nodes: List[_NL], results: _Results | None = ...) -> bool: ...
def generate_matches(self, nodes: List[_NL]) -> Iterator[Tuple[int, _Results]]: ...
def match_seq(self, nodes: list[_NL], results: _Results | None = ...) -> bool: ...
def generate_matches(self, nodes: list[_NL]) -> Iterator[Tuple[int, _Results]]: ...
class LeafPattern(BasePattern):
def __init__(self, type: int | None = ..., content: str | None = ..., name: str | None = ...) -> None: ...
@@ -85,4 +85,4 @@ class WildcardPattern(BasePattern):
class NegatedPattern(BasePattern):
def __init__(self, content: str | None = ...) -> None: ...
def generate_matches(patterns: List[BasePattern], nodes: List[_NL]) -> Iterator[Tuple[int, _Results]]: ...
def generate_matches(patterns: list[BasePattern], nodes: list[_NL]) -> Iterator[Tuple[int, _Results]]: ...