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
ae36f3b1
Commit
ae36f3b1
authored
Oct 21, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctypedef casting, more cdef extern class work
parent
efaf3aea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
8 deletions
+13
-8
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-5
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+8
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
ae36f3b1
...
...
@@ -1225,7 +1225,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
return
Naming
.
modules_prefix
+
module_name
.
replace
(
"_"
,
"__"
).
replace
(
"."
,
"_"
)
def
generate_imported_module
(
self
,
module
,
code
):
import_module
=
0
import_module
=
module
.
has_extern_class
for
entry
in
module
.
cfunc_entries
:
if
entry
.
defined_in_pxd
:
import_module
=
1
...
...
@@ -1384,14 +1384,13 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
generate_module_import_code
(
self
,
module
,
env
,
code
):
import_module
=
0
import_module
=
module
.
has_extern_class
for
entry
in
module
.
cfunc_entries
:
if
entry
.
defined_in_pxd
:
import_module
=
1
for
entry
in
module
.
c_class_entries
:
if
entry
.
defined_in_pxd
:
import_module
=
1
print
"generate_module_import_code"
,
module
,
import_module
if
import_module
:
env
.
use_utility_code
(
import_module_utility_code
)
name
=
self
.
build_module_var_name
(
module
.
qualified_name
)
...
...
Cython/Compiler/Nodes.py
View file @
ae36f3b1
...
...
@@ -1509,8 +1509,9 @@ class CClassDefNode(StatNode):
self
.
module
=
module
if
self
.
module
is
None
:
self
.
module
=
ModuleScope
(
self
.
module_name
,
None
,
env
.
context
)
self
.
module
.
has_extern_class
=
1
env
.
cimported_modules
.
append
(
self
.
module
)
print
[
e
.
name
for
e
in
env
.
cimported_modules
]
if
self
.
base_class_name
:
if
self
.
base_class_module
:
base_class_scope
=
env
.
find_module
(
self
.
base_class_module
,
self
.
pos
)
...
...
@@ -1542,10 +1543,6 @@ class CClassDefNode(StatNode):
api
=
self
.
api
)
scope
=
self
.
entry
.
type
.
scope
if
self
.
module_name
:
self
.
entry
.
defined_in_pxd
=
1
self
.
module
.
c_class_entries
.
append
(
self
.
entry
)
if
self
.
doc
:
if
Options
.
embed_pos_in_docstring
:
scope
.
doc
=
'File: %s (starting at line %s)'
%
relative_position
(
self
.
pos
)
...
...
Cython/Compiler/PyrexTypes.py
View file @
ae36f3b1
...
...
@@ -163,6 +163,14 @@ class CTypedefType(BaseType):
def
as_argument_type
(
self
):
return
self
def
cast_code
(
self
,
expr_code
):
# If self is really an array (rather than pointer), we can't cast.
# For example, the gmp mpz_t.
if
self
.
typedef_base_type
.
is_ptr
:
return
self
.
typedef_base_type
.
cast_code
(
expr_code
)
else
:
return
BaseType
.
cast_code
(
self
,
expr_code
)
def
__repr__
(
self
):
return
"<CTypedefType %s>"
%
self
.
typedef_cname
...
...
Cython/Compiler/Symtab.py
View file @
ae36f3b1
...
...
@@ -700,6 +700,7 @@ class ModuleScope(Scope):
self
.
all_pystring_entries
=
[]
self
.
types_imported
=
{}
self
.
pynum_entries
=
[]
self
.
has_extern_class
=
0
def
qualifying_scope
(
self
):
return
self
.
parent_module
...
...
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