Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
d883088a
Commit
d883088a
authored
Dec 12, 2010
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename stuff from CyGenerator to __Pyx_Generator
parent
fd94a2bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+16
-16
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+9
-9
No files found.
Cython/Compiler/ExprNodes.py
View file @
d883088a
...
@@ -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 *__
Cy
Generator_Next(PyObject *self);
static PyObject *__
Pyx_
Generator_Next(PyObject *self);
static PyObject *__
Cy
Generator_Send(PyObject *self, PyObject *value);
static PyObject *__
Pyx_
Generator_Send(PyObject *self, PyObject *value);
static PyObject *__
Cy
Generator_Close(PyObject *self);
static PyObject *__
Pyx_
Generator_Close(PyObject *self);
static PyObject *__
Cy
Generator_Throw(PyObject *gen, PyObject *args, CYTHON_UNUSED PyObject *kwds);
static PyObject *__
Pyx_
Generator_Throw(PyObject *gen, PyObject *args, CYTHON_UNUSED PyObject *kwds);
typedef PyObject *(*__
cy
generator_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 *__
Cy
Generator_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 *__
Cy
Generator_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 *__
Cy
Generator_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 = __
Cy
Generator_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 *__
Cy
Generator_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 __
Cy
Generator_SendEx(generator, NULL);
return __
Pyx_
Generator_SendEx(generator, NULL);
}
}
"""
,
"""
,
proto_block
=
'utility_code_proto_before_types'
,
proto_block
=
'utility_code_proto_before_types'
,
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
d883088a
...
@@ -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
=
'__
Cy
Generator'
,
entry
=
target_module_scope
.
declare_c_class
(
name
=
'__
pyx_
Generator'
,
objstruct_cname
=
'__
CyGenerator
'
,
objstruct_cname
=
'__
pyx_Generator_object
'
,
typeobj_cname
=
'__
CyGeneratorT
ype'
,
typeobj_cname
=
'__
pyx_Generator_t
ype'
,
pos
=
pos
,
defining
=
True
,
implementing
=
True
)
pos
=
pos
,
defining
=
True
,
implementing
=
True
)
entry
.
cname
=
'
Cy
Generator'
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
,
'__
cy
generator_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
=
'__
Cy
Generator_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
=
'__
Cy
Generator_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
=
'__
Cy
Generator_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
=
'__
Cy
Generator_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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment