massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 3 / sre_parse.pyi
1 # Source: https://github.com/python/cpython/blob/master/Lib/sre_parse.py\r
2 \r
3 from typing import (\r
4     Any, Dict, FrozenSet, Iterable, List, Match,\r
5     Optional, Pattern as _Pattern, Tuple, Union\r
6 )\r
7 from sre_constants import _NamedIntConstant as NIC, error as _Error\r
8 \r
9 SPECIAL_CHARS = ...  # type: str\r
10 REPEAT_CHARS = ...  # type: str\r
11 DIGITS = ...  # type: FrozenSet[str]\r
12 OCTDIGITS = ...  # type: FrozenSet[str]\r
13 HEXDIGITS = ...  # type: FrozenSet[str]\r
14 ASCIILETTERS = ...  # type: FrozenSet[str]\r
15 WHITESPACE = ...  # type: FrozenSet[str]\r
16 ESCAPES = ...  # type: Dict[str, Tuple[NIC, int]]\r
17 CATEGORIES = ...  # type: Dict[str, Union[Tuple[NIC, NIC], Tuple[NIC, List[Tuple[NIC, NIC]]]]]\r
18 FLAGS = ...  # type: Dict[str, int]\r
19 GLOBAL_FLAGS = ...  # type: int\r
20 \r
21 class Verbose(Exception): ...\r
22 \r
23 class Pattern:\r
24     flags = ...  # type: int\r
25     groupdict = ...  # type: Dict[str, int]\r
26     groupwidths = ...  # type: List[Optional[int]]\r
27     lookbehindgroups = ...  # type: Optional[int]\r
28     def __init__(self) -> None: ...\r
29     @property\r
30     def groups(self) -> int: ...\r
31     def opengroup(self, name: str = ...) -> int: ...\r
32     def closegroup(self, gid: int, p: SubPattern) -> None: ...\r
33     def checkgroup(self, gid: int) -> bool: ...\r
34     def checklookbehindgroup(self, gid: int, source: Tokenizer) -> None: ...\r
35 \r
36 \r
37 _OpSubpatternType = Tuple[Optional[int], int, int, SubPattern]\r
38 _OpGroupRefExistsType = Tuple[int, SubPattern, SubPattern]\r
39 _OpInType = List[Tuple[NIC, int]]\r
40 _OpBranchType = Tuple[None, List[SubPattern]]\r
41 _AvType = Union[_OpInType, _OpBranchType, Iterable[SubPattern], _OpGroupRefExistsType, _OpSubpatternType]\r
42 _CodeType = Tuple[NIC, _AvType]\r
43 \r
44 \r
45 class SubPattern:\r
46     pattern = ...  # type: Pattern\r
47     data = ...  # type: List[_CodeType]\r
48     width = ...  # type: Optional[int]\r
49     def __init__(self, pattern: Pattern, data: List[_CodeType] = ...) -> None: ...\r
50     def dump(self, level: int = ...) -> None: ...\r
51     def __len__(self) -> int: ...\r
52     def __delitem__(self, index: Union[int, slice]) -> None: ...\r
53     def __getitem__(self, index: Union[int, slice]) -> Union[SubPattern, _CodeType]: ...\r
54     def __setitem__(self, index: Union[int, slice], code: _CodeType) -> None: ...\r
55     def insert(self, index: int, code: _CodeType) -> None: ...\r
56     def append(self, code: _CodeType) -> None: ...\r
57     def getwidth(self) -> int: ...\r
58 \r
59 \r
60 class Tokenizer:\r
61     istext = ...  # type: bool\r
62     string = ...  # type: Any\r
63     decoded_string = ...  # type: str\r
64     index = ...  # type: int\r
65     next = ...  # type: Optional[str]\r
66     def __init__(self, string: Any) -> None: ...\r
67     def match(self, char: str) -> bool: ...\r
68     def get(self) -> Optional[str]: ...\r
69     def getwhile(self, n: int, charset: Iterable[str]) -> str: ...\r
70     def getuntil(self, terminator: str) -> str: ...\r
71     @property\r
72     def pos(self) -> int: ...\r
73     def tell(self) -> int: ...\r
74     def seek(self, index: int) -> None: ...\r
75     def error(self, msg: str, offset: int = ...) -> _Error: ...\r
76 \r
77 def fix_flags(src: Union[str, bytes], flag: int) -> int: ...\r
78 def parse(str: str, flags: int = ..., pattern: Pattern = ...) -> SubPattern: ...\r
79 _TemplateType = Tuple[List[Tuple[int, int]], List[str]]\r
80 def parse_template(source: str, pattern: _Pattern) -> _TemplateType: ...\r
81 def expand_template(template: _TemplateType, match: Match) -> str: ...\r