Commit d883088a authored by Vitja Makarov's avatar Vitja Makarov

Rename stuff from CyGenerator to __Pyx_Generator

parent fd94a2bd
...@@ -8302,15 +8302,15 @@ int %(binding_cfunc)s_init(void) { ...@@ -8302,15 +8302,15 @@ int %(binding_cfunc)s_init(void) {
generator_utility_code = UtilityCode( generator_utility_code = UtilityCode(
proto=""" proto="""
static PyObject *__CyGenerator_Next(PyObject *self); static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__CyGenerator_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
static PyObject *__CyGenerator_Close(PyObject *self); static PyObject *__Pyx_Generator_Close(PyObject *self);
static PyObject *__CyGenerator_Throw(PyObject *gen, PyObject *args, CYTHON_UNUSED PyObject *kwds); static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args, CYTHON_UNUSED PyObject *kwds);
typedef PyObject *(*__cygenerator_body_t)(PyObject *, PyObject *); typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
""", """,
impl=""" impl="""
static CYTHON_INLINE PyObject *__CyGenerator_SendEx(struct __CyGenerator *self, PyObject *value) static CYTHON_INLINE PyObject *__Pyx_Generator_SendEx(struct __pyx_Generator_object *self, PyObject *value)
{ {
PyObject *retval; PyObject *retval;
...@@ -8341,22 +8341,22 @@ static CYTHON_INLINE PyObject *__CyGenerator_SendEx(struct __CyGenerator *self, ...@@ -8341,22 +8341,22 @@ static CYTHON_INLINE PyObject *__CyGenerator_SendEx(struct __CyGenerator *self,
return retval; return retval;
} }
static PyObject *__CyGenerator_Next(PyObject *self) static PyObject *__Pyx_Generator_Next(PyObject *self)
{ {
return __CyGenerator_SendEx((struct __CyGenerator *) self, Py_None); return __Pyx_Generator_SendEx((struct __pyx_Generator_object *) self, Py_None);
} }
static PyObject *__CyGenerator_Send(PyObject *self, PyObject *value) static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value)
{ {
return __CyGenerator_SendEx((struct __CyGenerator *) self, value); return __Pyx_Generator_SendEx((struct __pyx_Generator_object *) self, value);
} }
static PyObject *__CyGenerator_Close(PyObject *self) static PyObject *__Pyx_Generator_Close(PyObject *self)
{ {
struct __CyGenerator *generator = (struct __CyGenerator *) self; struct __pyx_Generator_object *generator = (struct __pyx_Generator_object *) self;
PyObject *retval; PyObject *retval;
PyErr_SetNone(PyExc_GeneratorExit); PyErr_SetNone(PyExc_GeneratorExit);
retval = __CyGenerator_SendEx(generator, NULL); retval = __Pyx_Generator_SendEx(generator, NULL);
if (retval) { if (retval) {
Py_DECREF(retval); Py_DECREF(retval);
PyErr_SetString(PyExc_RuntimeError, PyErr_SetString(PyExc_RuntimeError,
...@@ -8373,9 +8373,9 @@ static PyObject *__CyGenerator_Close(PyObject *self) ...@@ -8373,9 +8373,9 @@ static PyObject *__CyGenerator_Close(PyObject *self)
return NULL; return NULL;
} }
static PyObject *__CyGenerator_Throw(PyObject *self, PyObject *args, CYTHON_UNUSED PyObject *kwds) static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args, CYTHON_UNUSED PyObject *kwds)
{ {
struct __CyGenerator *generator = (struct __CyGenerator *) self; struct __pyx_Generator_object *generator = (struct __pyx_Generator_object *) self;
PyObject *typ; PyObject *typ;
PyObject *tb = NULL; PyObject *tb = NULL;
PyObject *val = NULL; PyObject *val = NULL;
...@@ -8383,7 +8383,7 @@ static PyObject *__CyGenerator_Throw(PyObject *self, PyObject *args, CYTHON_UNUS ...@@ -8383,7 +8383,7 @@ static PyObject *__CyGenerator_Throw(PyObject *self, PyObject *args, CYTHON_UNUS
if (!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb)) if (!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))
return NULL; return NULL;
__Pyx_Raise(typ, val, tb); __Pyx_Raise(typ, val, tb);
return __CyGenerator_SendEx(generator, NULL); return __Pyx_Generator_SendEx(generator, NULL);
} }
""", """,
proto_block='utility_code_proto_before_types', proto_block='utility_code_proto_before_types',
......
...@@ -1433,18 +1433,18 @@ class CreateClosureClasses(CythonTransform): ...@@ -1433,18 +1433,18 @@ class CreateClosureClasses(CythonTransform):
if self.generator_class: if self.generator_class:
return self.generator_class return self.generator_class
# XXX: make generator class creation cleaner # XXX: make generator class creation cleaner
entry = target_module_scope.declare_c_class(name='__CyGenerator', entry = target_module_scope.declare_c_class(name='__pyx_Generator',
objstruct_cname='__CyGenerator', objstruct_cname='__pyx_Generator_object',
typeobj_cname='__CyGeneratorType', typeobj_cname='__pyx_Generator_type',
pos=pos, defining=True, implementing=True) pos=pos, defining=True, implementing=True)
entry.cname = 'CyGenerator' entry.cname = 'Generator'
klass = entry.type.scope klass = entry.type.scope
klass.is_internal = True klass.is_internal = True
klass.directives = {'final': True} klass.directives = {'final': True}
body_type = PyrexTypes.create_typedef_type('generator_body', body_type = PyrexTypes.create_typedef_type('generator_body',
PyrexTypes.c_void_ptr_type, PyrexTypes.c_void_ptr_type,
'__cygenerator_body_t') '__pyx_generator_body_t')
klass.declare_var(pos=pos, name='body', cname='body', klass.declare_var(pos=pos, name='body', cname='body',
type=body_type, is_cdef=True) type=body_type, is_cdef=True)
klass.declare_var(pos=pos, name='is_running', cname='is_running', type=PyrexTypes.c_int_type, klass.declare_var(pos=pos, name='is_running', cname='is_running', type=PyrexTypes.c_int_type,
...@@ -1454,22 +1454,22 @@ class CreateClosureClasses(CythonTransform): ...@@ -1454,22 +1454,22 @@ class CreateClosureClasses(CythonTransform):
import TypeSlots import TypeSlots
e = klass.declare_pyfunction('send', pos) e = klass.declare_pyfunction('send', pos)
e.func_cname = '__CyGenerator_Send' e.func_cname = '__Pyx_Generator_Send'
e.signature = TypeSlots.binaryfunc e.signature = TypeSlots.binaryfunc
e = klass.declare_pyfunction('close', pos) e = klass.declare_pyfunction('close', pos)
e.func_cname = '__CyGenerator_Close' e.func_cname = '__Pyx_Generator_Close'
e.signature = TypeSlots.unaryfunc e.signature = TypeSlots.unaryfunc
e = klass.declare_pyfunction('throw', pos) e = klass.declare_pyfunction('throw', pos)
e.func_cname = '__CyGenerator_Throw' e.func_cname = '__Pyx_Generator_Throw'
e.signature = TypeSlots.pyfunction_signature e.signature = TypeSlots.pyfunction_signature
e = klass.declare_var('__iter__', PyrexTypes.py_object_type, pos, visibility='public') e = klass.declare_var('__iter__', PyrexTypes.py_object_type, pos, visibility='public')
e.func_cname = 'PyObject_SelfIter' e.func_cname = 'PyObject_SelfIter'
e = klass.declare_var('__next__', PyrexTypes.py_object_type, pos, visibility='public') e = klass.declare_var('__next__', PyrexTypes.py_object_type, pos, visibility='public')
e.func_cname = '__CyGenerator_Next' e.func_cname = '__Pyx_Generator_Next'
self.generator_class = entry.type self.generator_class = entry.type
return self.generator_class return self.generator_class
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment