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