| 1 |
from typing import Final |
| 2 |
|
| 3 |
from .errors import ( |
| 4 |
ClinicError, |
| 5 |
warn, |
| 6 |
fail, |
| 7 |
) |
| 8 |
from .formatting import ( |
| 9 |
SIG_END_MARKER, |
| 10 |
c_str_repr, |
| 11 |
c_bytes_repr, |
| 12 |
c_unichar_repr, |
| 13 |
docstring_for_c_string, |
| 14 |
format_escape, |
| 15 |
indent_all_lines, |
| 16 |
linear_format, |
| 17 |
normalize_snippet, |
| 18 |
pprint_words, |
| 19 |
suffix_all_lines, |
| 20 |
wrap_declarations, |
| 21 |
wrapped_c_string_literal, |
| 22 |
) |
| 23 |
from .identifiers import ( |
| 24 |
ensure_legal_c_identifier, |
| 25 |
is_legal_c_identifier, |
| 26 |
is_legal_py_identifier, |
| 27 |
) |
| 28 |
from .utils import ( |
| 29 |
FormatCounterFormatter, |
| 30 |
NULL, |
| 31 |
NullType, |
| 32 |
Sentinels, |
| 33 |
VersionTuple, |
| 34 |
compute_checksum, |
| 35 |
create_regex, |
| 36 |
unknown, |
| 37 |
unspecified, |
| 38 |
write_file, |
| 39 |
) |
| 40 |
|
| 41 |
|
| 42 |
__all__ = [ |
| 43 |
# Error handling |
| 44 |
"ClinicError", |
| 45 |
"warn", |
| 46 |
"fail", |
| 47 |
|
| 48 |
# Formatting helpers |
| 49 |
"SIG_END_MARKER", |
| 50 |
"c_str_repr", |
| 51 |
"c_bytes_repr", |
| 52 |
"c_unichar_repr", |
| 53 |
"docstring_for_c_string", |
| 54 |
"format_escape", |
| 55 |
"indent_all_lines", |
| 56 |
"linear_format", |
| 57 |
"normalize_snippet", |
| 58 |
"pprint_words", |
| 59 |
"suffix_all_lines", |
| 60 |
"wrap_declarations", |
| 61 |
"wrapped_c_string_literal", |
| 62 |
|
| 63 |
# Identifier helpers |
| 64 |
"ensure_legal_c_identifier", |
| 65 |
"is_legal_c_identifier", |
| 66 |
"is_legal_py_identifier", |
| 67 |
|
| 68 |
# Utility functions |
| 69 |
"FormatCounterFormatter", |
| 70 |
"NULL", |
| 71 |
"NullType", |
| 72 |
"Sentinels", |
| 73 |
"VersionTuple", |
| 74 |
"compute_checksum", |
| 75 |
"create_regex", |
| 76 |
"unknown", |
| 77 |
"unspecified", |
| 78 |
"write_file", |
| 79 |
] |
| 80 |
|
| 81 |
|
| 82 |
CLINIC_PREFIX: Final = "__clinic_" |
| 83 |
CLINIC_PREFIXED_ARGS: Final = frozenset( |
| 84 |
{ |
| 85 |
"_keywords", |
| 86 |
"_parser", |
| 87 |
"args", |
| 88 |
"argsbuf", |
| 89 |
"fastargs", |
| 90 |
"kwargs", |
| 91 |
"kwnames", |
| 92 |
"nargs", |
| 93 |
"noptargs", |
| 94 |
"return_value", |
| 95 |
} |
| 96 |
) |