mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-03 18:13:36 +08:00
stdlib: add argument default values (#9501)
This commit is contained in:
@@ -12,13 +12,13 @@ class Driver:
|
||||
grammar: Grammar
|
||||
logger: Logger
|
||||
convert: _Convert
|
||||
def __init__(self, grammar: Grammar, convert: _Convert | None = ..., logger: Logger | None = ...) -> None: ...
|
||||
def parse_tokens(self, tokens: Iterable[Any], debug: bool = ...) -> _NL: ...
|
||||
def parse_stream_raw(self, stream: IO[str], debug: bool = ...) -> _NL: ...
|
||||
def parse_stream(self, stream: IO[str], debug: bool = ...) -> _NL: ...
|
||||
def parse_file(self, filename: StrPath, encoding: str | None = ..., debug: bool = ...) -> _NL: ...
|
||||
def parse_string(self, text: str, debug: bool = ...) -> _NL: ...
|
||||
def __init__(self, grammar: Grammar, convert: _Convert | None = None, logger: Logger | None = None) -> None: ...
|
||||
def parse_tokens(self, tokens: Iterable[Any], debug: bool = False) -> _NL: ...
|
||||
def parse_stream_raw(self, stream: IO[str], debug: bool = False) -> _NL: ...
|
||||
def parse_stream(self, stream: IO[str], debug: bool = False) -> _NL: ...
|
||||
def parse_file(self, filename: StrPath, encoding: str | None = None, debug: bool = False) -> _NL: ...
|
||||
def parse_string(self, text: str, debug: bool = False) -> _NL: ...
|
||||
|
||||
def load_grammar(
|
||||
gt: str = ..., gp: str | None = ..., save: bool = ..., force: bool = ..., logger: Logger | None = ...
|
||||
gt: str = "Grammar.txt", gp: str | None = None, save: bool = True, force: bool = False, logger: Logger | None = None
|
||||
) -> Grammar: ...
|
||||
|
||||
@@ -20,8 +20,8 @@ class Parser:
|
||||
stack: list[tuple[_DFAS, int, _RawNode]]
|
||||
rootnode: _NL | None
|
||||
used_names: set[str]
|
||||
def __init__(self, grammar: Grammar, convert: _Convert | None = ...) -> None: ...
|
||||
def setup(self, start: int | None = ...) -> None: ...
|
||||
def __init__(self, grammar: Grammar, convert: _Convert | None = None) -> None: ...
|
||||
def setup(self, start: int | None = None) -> None: ...
|
||||
def addtoken(self, type: int, value: str | None, context: _Context) -> bool: ...
|
||||
def classify(self, type: int, value: str | None, context: _Context) -> int: ...
|
||||
def shift(self, type: int, value: str | None, newstate: int, context: _Context) -> None: ...
|
||||
|
||||
@@ -11,7 +11,7 @@ class ParserGenerator:
|
||||
stream: IO[str]
|
||||
generator: Iterator[_TokenInfo]
|
||||
first: dict[str, dict[str, int]]
|
||||
def __init__(self, filename: StrPath, stream: IO[str] | None = ...) -> None: ...
|
||||
def __init__(self, filename: StrPath, stream: IO[str] | None = None) -> None: ...
|
||||
def make_grammar(self) -> PgenGrammar: ...
|
||||
def make_first(self, c: PgenGrammar, name: str) -> dict[int, int]: ...
|
||||
def make_label(self, c: PgenGrammar, label: str) -> int: ...
|
||||
@@ -26,13 +26,13 @@ class ParserGenerator:
|
||||
def parse_alt(self) -> tuple[NFAState, NFAState]: ...
|
||||
def parse_item(self) -> tuple[NFAState, NFAState]: ...
|
||||
def parse_atom(self) -> tuple[NFAState, NFAState]: ...
|
||||
def expect(self, type: int, value: Any | None = ...) -> str: ...
|
||||
def expect(self, type: int, value: Any | None = None) -> str: ...
|
||||
def gettoken(self) -> None: ...
|
||||
def raise_error(self, msg: str, *args: Any) -> NoReturn: ...
|
||||
|
||||
class NFAState:
|
||||
arcs: list[tuple[str | None, NFAState]]
|
||||
def addarc(self, next: NFAState, label: str | None = ...) -> None: ...
|
||||
def addarc(self, next: NFAState, label: str | None = None) -> None: ...
|
||||
|
||||
class DFAState:
|
||||
nfaset: dict[NFAState, Any]
|
||||
@@ -43,4 +43,4 @@ class DFAState:
|
||||
def unifystate(self, old: DFAState, new: DFAState) -> None: ...
|
||||
def __eq__(self, other: DFAState) -> bool: ... # type: ignore[override]
|
||||
|
||||
def generate_grammar(filename: StrPath = ...) -> PgenGrammar: ...
|
||||
def generate_grammar(filename: StrPath = "Grammar.txt") -> PgenGrammar: ...
|
||||
|
||||
Reference in New Issue
Block a user