massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / Pygments / pygments / lexer.pyi
1 from collections.abc import Iterable, Iterator, Sequence
2 from typing import Any, Tuple
3
4 from pygments.token import _TokenType
5 from pygments.util import Future
6
7 class LexerMeta(type):
8     def __new__(cls, name, bases, d): ...
9     def analyse_text(self, text) -> None: ...  # actually defined in class Lexer
10     # ClassVars of Lexer, but same situation as with StyleMeta and Style
11     name: str
12     aliases: Sequence[str]  # not intended mutable
13     filenames: Sequence[str]
14     alias_filenames: Sequence[str]
15     mimetypes: Sequence[str]
16     priority: int
17
18 class Lexer(metaclass=LexerMeta):
19     options: Any
20     stripnl: Any
21     stripall: Any
22     ensurenl: Any
23     tabsize: Any
24     encoding: Any
25     filters: Any
26     def __init__(self, **options) -> None: ...
27     def add_filter(self, filter_, **options) -> None: ...
28     def get_tokens(self, text: str, unfiltered: bool = ...) -> Iterator[tuple[_TokenType, str]]: ...
29     def get_tokens_unprocessed(self, text: str) -> Iterator[tuple[int, _TokenType, str]]: ...
30
31 class DelegatingLexer(Lexer):
32     root_lexer: Any
33     language_lexer: Any
34     needle: Any
35     def __init__(self, _root_lexer, _language_lexer, _needle=..., **options) -> None: ...
36     def get_tokens_unprocessed(self, text: str) -> Iterator[tuple[int, _TokenType, str]]: ...
37
38 class include(str): ...
39 class _inherit: ...
40
41 inherit: Any
42
43 class combined(Tuple[Any]):
44     def __new__(cls, *args): ...
45     def __init__(self, *args) -> None: ...
46
47 class _PseudoMatch:
48     def __init__(self, start, text) -> None: ...
49     def start(self, arg: Any | None = ...): ...
50     def end(self, arg: Any | None = ...): ...
51     def group(self, arg: Any | None = ...): ...
52     def groups(self): ...
53     def groupdict(self): ...
54
55 def bygroups(*args): ...
56
57 class _This: ...
58
59 this: Any
60
61 def using(_other, **kwargs): ...
62
63 class default:
64     state: Any
65     def __init__(self, state) -> None: ...
66
67 class words(Future):
68     words: Any
69     prefix: Any
70     suffix: Any
71     def __init__(self, words, prefix: str = ..., suffix: str = ...) -> None: ...
72     def get(self): ...
73
74 class RegexLexerMeta(LexerMeta):
75     def process_tokendef(cls, name, tokendefs: Any | None = ...): ...
76     def get_tokendefs(cls): ...
77     def __call__(cls, *args, **kwds): ...
78
79 class RegexLexer(Lexer, metaclass=RegexLexerMeta):
80     flags: Any
81     tokens: Any
82     def get_tokens_unprocessed(self, text: str, stack: Iterable[str] = ...) -> Iterator[tuple[int, _TokenType, str]]: ...
83
84 class LexerContext:
85     text: Any
86     pos: Any
87     end: Any
88     stack: Any
89     def __init__(self, text, pos, stack: Any | None = ..., end: Any | None = ...) -> None: ...
90
91 class ExtendedRegexLexer(RegexLexer):
92     def get_tokens_unprocessed(self, text: str | None = ..., context: LexerContext | None = ...) -> Iterator[tuple[int, _TokenType, str]]: ...  # type: ignore
93
94 class ProfilingRegexLexerMeta(RegexLexerMeta): ...
95
96 class ProfilingRegexLexer(RegexLexer, metaclass=ProfilingRegexLexerMeta):
97     def get_tokens_unprocessed(self, text: str, stack: Iterable[str] = ...) -> Iterator[tuple[int, _TokenType, str]]: ...