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) {
generator_utility_code
=
UtilityCode
(
proto
=
"""
static PyObject *__
Cy
Generator_Next(PyObject *self);
static PyObject *__
Cy
Generator_Send(PyObject *self, PyObject *value);
static PyObject *__
Cy
Generator_Close(PyObject *self);
static PyObject *__
Cy
Generator_Throw(PyObject *gen, PyObject *args, CYTHON_UNUSED PyObject *kwds);
static PyObject *__
Pyx_
Generator_Next(PyObject *self);
static PyObject *__
Pyx_
Generator_Send(PyObject *self, PyObject *value);
static PyObject *__
Pyx_
Generator_Close(PyObject *self);
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
=
"""
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;
...
...
@@ -8341,22 +8341,22 @@ static CYTHON_INLINE PyObject *__CyGenerator_SendEx(struct __CyGenerator *self,
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;
PyErr_SetNone(PyExc_GeneratorExit);
retval = __
Cy
Generator_SendEx(generator, NULL);
retval = __
Pyx_
Generator_SendEx(generator, NULL);
if (retval) {
Py_DECREF(retval);
PyErr_SetString(PyExc_RuntimeError,
...
...
@@ -8373,9 +8373,9 @@ static PyObject *__CyGenerator_Close(PyObject *self)
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 *tb = NULL;
PyObject *val = NULL;
...
...
@@ -8383,7 +8383,7 @@ static PyObject *__CyGenerator_Throw(PyObject *self, PyObject *args, CYTHON_UNUS
if (!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))
return NULL;
__Pyx_Raise(typ, val, tb);
return __
Cy
Generator_SendEx(generator, NULL);
return __
Pyx_
Generator_SendEx(generator, NULL);
}
"""
,
proto_block
=
'utility_code_proto_before_types'
,
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
d883088a
...
...
@@ -1433,18 +1433,18 @@ class CreateClosureClasses(CythonTransform):
if
self
.
generator_class
:
return
self
.
generator_class
# XXX: make generator class creation cleaner
entry
=
target_module_scope
.
declare_c_class
(
name
=
'__
Cy
Generator'
,
objstruct_cname
=
'__
CyGenerator
'
,
typeobj_cname
=
'__
CyGeneratorT
ype'
,
entry
=
target_module_scope
.
declare_c_class
(
name
=
'__
pyx_
Generator'
,
objstruct_cname
=
'__
pyx_Generator_object
'
,
typeobj_cname
=
'__
pyx_Generator_t
ype'
,
pos
=
pos
,
defining
=
True
,
implementing
=
True
)
entry
.
cname
=
'
Cy
Generator'
entry
.
cname
=
'Generator'
klass
=
entry
.
type
.
scope
klass
.
is_internal
=
True
klass
.
directives
=
{
'final'
:
True
}
body_type
=
PyrexTypes
.
create_typedef_type
(
'generator_body'
,
PyrexTypes
.
c_void_ptr_type
,
'__
cy
generator_body_t'
)
'__
pyx_
generator_body_t'
)
klass
.
declare_var
(
pos
=
pos
,
name
=
'body'
,
cname
=
'body'
,
type
=
body_type
,
is_cdef
=
True
)
klass
.
declare_var
(
pos
=
pos
,
name
=
'is_running'
,
cname
=
'is_running'
,
type
=
PyrexTypes
.
c_int_type
,
...
...
@@ -1454,22 +1454,22 @@ class CreateClosureClasses(CythonTransform):
import
TypeSlots
e
=
klass
.
declare_pyfunction
(
'send'
,
pos
)
e
.
func_cname
=
'__
Cy
Generator_Send'
e
.
func_cname
=
'__
Pyx_
Generator_Send'
e
.
signature
=
TypeSlots
.
binaryfunc
e
=
klass
.
declare_pyfunction
(
'close'
,
pos
)
e
.
func_cname
=
'__
Cy
Generator_Close'
e
.
func_cname
=
'__
Pyx_
Generator_Close'
e
.
signature
=
TypeSlots
.
unaryfunc
e
=
klass
.
declare_pyfunction
(
'throw'
,
pos
)
e
.
func_cname
=
'__
Cy
Generator_Throw'
e
.
func_cname
=
'__
Pyx_
Generator_Throw'
e
.
signature
=
TypeSlots
.
pyfunction_signature
e
=
klass
.
declare_var
(
'__iter__'
,
PyrexTypes
.
py_object_type
,
pos
,
visibility
=
'public'
)
e
.
func_cname
=
'PyObject_SelfIter'
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
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