Debian Codegraph @

Tools/clinic/libclinic/__init__.py

raw
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 FileChange,
30 FileWriter,
31 FormatCounterFormatter,
32 NULL,
33 NullType,
34 Sentinels,
35 VersionTuple,
36 compute_checksum,
37 create_regex,
38 read_file,
39 unknown,
40 unspecified,
41 write_file,
42 )
43
44
45 __all__ = [
46 # Error handling
47 "ClinicError",
48 "warn",
49 "fail",
50
51 # Formatting helpers
52 "SIG_END_MARKER",
53 "c_str_repr",
54 "c_bytes_repr",
55 "c_unichar_repr",
56 "docstring_for_c_string",
57 "format_escape",
58 "indent_all_lines",
59 "linear_format",
60 "normalize_snippet",
61 "pprint_words",
62 "suffix_all_lines",
63 "wrap_declarations",
64 "wrapped_c_string_literal",
65
66 # Identifier helpers
67 "ensure_legal_c_identifier",
68 "is_legal_c_identifier",
69 "is_legal_py_identifier",
70
71 # Utility functions
72 "FileChange",
73 "FileWriter",
74 "FormatCounterFormatter",
75 "NULL",
76 "NullType",
77 "Sentinels",
78 "VersionTuple",
79 "compute_checksum",
80 "create_regex",
81 "read_file",
82 "unknown",
83 "unspecified",
84 "write_file",
85 ]
86
87
88 CLINIC_PREFIX: Final = "__clinic_"
89 CLINIC_PREFIXED_ARGS: Final = frozenset(
90 {
91 "_keywords",
92 "_parser",
93 "args",
94 "argsbuf",
95 "fastargs",
96 "kwargs",
97 "kwnames",
98 "nargs",
99 "noptargs",
100 "return_value",
101 }
102 )