2023-12-22 20:37:39 -04:00
|
|
|
from typing import Final
|
|
|
|
|
2023-12-27 17:43:19 -04:00
|
|
|
from .errors import (
|
|
|
|
ClinicError,
|
|
|
|
)
|
2023-12-22 20:37:39 -04:00
|
|
|
from .formatting import (
|
2023-12-23 13:08:10 -04:00
|
|
|
SIG_END_MARKER,
|
2023-12-22 20:37:39 -04:00
|
|
|
c_repr,
|
|
|
|
docstring_for_c_string,
|
2023-12-23 13:08:10 -04:00
|
|
|
format_escape,
|
2023-12-22 20:37:39 -04:00
|
|
|
indent_all_lines,
|
2023-12-23 13:08:10 -04:00
|
|
|
normalize_snippet,
|
2023-12-22 20:37:39 -04:00
|
|
|
pprint_words,
|
|
|
|
suffix_all_lines,
|
2023-12-23 13:08:10 -04:00
|
|
|
wrap_declarations,
|
2023-12-22 20:37:39 -04:00
|
|
|
wrapped_c_string_literal,
|
|
|
|
)
|
2024-01-14 14:26:09 -04:00
|
|
|
from .utils import (
|
2024-01-14 19:09:26 -04:00
|
|
|
FormatCounterFormatter,
|
2024-01-14 14:26:09 -04:00
|
|
|
compute_checksum,
|
2024-01-14 19:09:26 -04:00
|
|
|
create_regex,
|
2024-01-14 14:26:09 -04:00
|
|
|
write_file,
|
|
|
|
)
|
2023-12-22 20:37:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
__all__ = [
|
2023-12-27 17:43:19 -04:00
|
|
|
# Error handling
|
|
|
|
"ClinicError",
|
|
|
|
|
2023-12-22 20:37:39 -04:00
|
|
|
# Formatting helpers
|
2023-12-23 13:08:10 -04:00
|
|
|
"SIG_END_MARKER",
|
2023-12-22 20:37:39 -04:00
|
|
|
"c_repr",
|
|
|
|
"docstring_for_c_string",
|
2023-12-23 13:08:10 -04:00
|
|
|
"format_escape",
|
2023-12-22 20:37:39 -04:00
|
|
|
"indent_all_lines",
|
2023-12-23 13:08:10 -04:00
|
|
|
"normalize_snippet",
|
2023-12-22 20:37:39 -04:00
|
|
|
"pprint_words",
|
|
|
|
"suffix_all_lines",
|
2023-12-23 13:08:10 -04:00
|
|
|
"wrap_declarations",
|
2023-12-22 20:37:39 -04:00
|
|
|
"wrapped_c_string_literal",
|
2024-01-14 14:26:09 -04:00
|
|
|
|
|
|
|
# Utility functions
|
2024-01-14 19:09:26 -04:00
|
|
|
"FormatCounterFormatter",
|
2024-01-14 14:26:09 -04:00
|
|
|
"compute_checksum",
|
2024-01-14 19:09:26 -04:00
|
|
|
"create_regex",
|
2024-01-14 14:26:09 -04:00
|
|
|
"write_file",
|
2023-12-22 20:37:39 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
CLINIC_PREFIX: Final = "__clinic_"
|
|
|
|
CLINIC_PREFIXED_ARGS: Final = frozenset(
|
|
|
|
{
|
|
|
|
"_keywords",
|
|
|
|
"_parser",
|
|
|
|
"args",
|
|
|
|
"argsbuf",
|
|
|
|
"fastargs",
|
|
|
|
"kwargs",
|
|
|
|
"kwnames",
|
|
|
|
"nargs",
|
|
|
|
"noptargs",
|
|
|
|
"return_value",
|
|
|
|
}
|
|
|
|
)
|