cython

Форк
0
140 строк · 3.6 Кб
1
cimport cython
2
from ..StringIOTree cimport StringIOTree
3

4

5
cdef class UtilityCodeBase(object):
6
    cpdef format_code(self, code_string, replace_empty_lines=*)
7

8

9
cdef class UtilityCode(UtilityCodeBase):
10
    cdef public object name
11
    cdef public object proto
12
    cdef public object impl
13
    cdef public object init
14
    cdef public object cleanup
15
    cdef public object proto_block
16
    cdef public object requires
17
    cdef public dict _cache
18
    cdef public list specialize_list
19
    cdef public object file
20

21
    cpdef none_or_sub(self, s, context)
22

23

24
cdef class FunctionState:
25
    cdef public set names_taken
26
    cdef public object owner
27
    cdef public object scope
28

29
    cdef public object error_label
30
    cdef public size_t label_counter
31
    cdef public set labels_used
32
    cdef public object return_label
33
    cdef public object continue_label
34
    cdef public object break_label
35
    cdef public list yield_labels
36

37
    cdef public object return_from_error_cleanup_label # not used in __init__ ?
38

39
    cdef public object exc_vars
40
    cdef public object current_except
41
    cdef public bint in_try_finally
42
    cdef public bint can_trace
43
    cdef public bint gil_owned
44

45
    cdef public list temps_allocated
46
    cdef public dict temps_free
47
    cdef public dict temps_used_type
48
    cdef public set zombie_temps
49
    cdef public size_t temp_counter
50
    cdef public list collect_temps_stack
51

52
    cdef public object closure_temps
53
    cdef public bint should_declare_error_indicator
54
    cdef public bint uses_error_indicator
55
    cdef public bint error_without_exception
56

57
    cdef public bint needs_refnanny
58

59
    cpdef new_label(self, name=*)
60
    cpdef tuple get_loop_labels(self)
61
    cpdef set_loop_labels(self, labels)
62
    cpdef tuple get_all_labels(self)
63
    cpdef set_all_labels(self, labels)
64
    cpdef start_collecting_temps(self)
65
    cpdef stop_collecting_temps(self)
66

67
    cpdef list temps_in_use(self)
68

69
cdef class IntConst:
70
    cdef public object cname
71
    cdef public object value
72
    cdef public bint is_long
73

74
cdef class PyObjectConst:
75
    cdef public object cname
76
    cdef public object type
77

78
cdef class StringConst:
79
    cdef public object cname
80
    cdef public object text
81
    cdef public object escaped_value
82
    cdef public dict py_strings
83
    cdef public list py_versions
84

85
    cpdef get_py_string_const(self, encoding, identifier=*)
86

87
## cdef class PyStringConst:
88
##     cdef public object cname
89
##     cdef public object encoding
90
##     cdef public bint is_str
91
##     cdef public bint is_unicode
92
##     cdef public bint intern
93

94
#class GlobalState(object):
95

96
#def funccontext_property(name):
97

98
cdef class CCodeWriter(object):
99
    cdef readonly StringIOTree buffer
100
    cdef readonly list pyclass_stack
101
    cdef readonly object globalstate
102
    cdef readonly object funcstate
103
    cdef object code_config
104
    cdef tuple last_pos
105
    cdef tuple last_marked_pos
106
    cdef Py_ssize_t level
107
    cdef public Py_ssize_t call_level  # debug-only, see Nodes.py
108
    cdef bint bol
109

110
    cpdef write(self, s)
111
    @cython.final
112
    cdef _write_lines(self, s)
113
    cpdef _write_to_buffer(self, s)
114
    cpdef put(self, code)
115
    cpdef put_safe(self, code)
116
    cpdef putln(self, code=*, bint safe=*)
117
    @cython.final
118
    cdef emit_marker(self)
119
    @cython.final
120
    cdef _build_marker(self, tuple pos)
121
    @cython.final
122
    cdef increase_indent(self)
123
    @cython.final
124
    cdef decrease_indent(self)
125
    @cython.final
126
    cdef indent(self)
127

128

129
cdef class PyrexCodeWriter:
130
    cdef public object f
131
    cdef public Py_ssize_t level
132

133

134
cdef class PyxCodeWriter:
135
    cdef public StringIOTree buffer
136
    cdef public object context
137
    cdef object encoding
138
    cdef Py_ssize_t level
139
    cdef Py_ssize_t original_level
140
    cdef dict _insertion_points
141

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.