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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
2a7e9ed0
Commit
2a7e9ed0
authored
Apr 29, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let Symbol Table handle Cypclass types
parent
d4701827
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+11
-5
No files found.
Cython/Compiler/Symtab.py
View file @
2a7e9ed0
...
@@ -17,7 +17,7 @@ from .Errors import warning, error, InternalError
...
@@ -17,7 +17,7 @@ from .Errors import warning, error, InternalError
from
.StringEncoding
import
EncodedString
from
.StringEncoding
import
EncodedString
from
.
import
Options
,
Naming
from
.
import
Options
,
Naming
from
.
import
PyrexTypes
from
.
import
PyrexTypes
from
.PyrexTypes
import
py_object_type
,
unspecified_type
from
.PyrexTypes
import
py_object_type
,
cy_object_type
,
unspecified_type
from
.TypeSlots
import
(
from
.TypeSlots
import
(
pyfunction_signature
,
pymethod_signature
,
richcmp_special_methods
,
pyfunction_signature
,
pymethod_signature
,
richcmp_special_methods
,
get_special_method_signature
,
get_property_accessor_signature
)
get_special_method_signature
,
get_property_accessor_signature
)
...
@@ -601,7 +601,7 @@ class Scope(object):
...
@@ -601,7 +601,7 @@ class Scope(object):
def
declare_cpp_class
(
self
,
name
,
scope
,
def
declare_cpp_class
(
self
,
name
,
scope
,
pos
,
cname
=
None
,
base_classes
=
(),
pos
,
cname
=
None
,
base_classes
=
(),
visibility
=
'extern'
,
templates
=
None
):
visibility
=
'extern'
,
templates
=
None
,
cypclass
=
0
):
if
cname
is
None
:
if
cname
is
None
:
if
self
.
in_cinclude
or
(
visibility
!=
'private'
):
if
self
.
in_cinclude
or
(
visibility
!=
'private'
):
cname
=
name
cname
=
name
...
@@ -610,8 +610,12 @@ class Scope(object):
...
@@ -610,8 +610,12 @@ class Scope(object):
base_classes
=
list
(
base_classes
)
base_classes
=
list
(
base_classes
)
entry
=
self
.
lookup_here
(
name
)
entry
=
self
.
lookup_here
(
name
)
if
not
entry
:
if
not
entry
:
type
=
PyrexTypes
.
CppClassType
(
if
cypclass
:
name
,
scope
,
cname
,
base_classes
,
templates
=
templates
)
type
=
PyrexTypes
.
CypClassType
(
name
,
scope
,
cname
,
base_classes
,
templates
=
templates
)
else
:
type
=
PyrexTypes
.
CppClassType
(
name
,
scope
,
cname
,
base_classes
,
templates
=
templates
)
entry
=
self
.
declare_type
(
name
,
type
,
pos
,
cname
,
entry
=
self
.
declare_type
(
name
,
type
,
pos
,
cname
,
visibility
=
visibility
,
defining
=
scope
is
not
None
)
visibility
=
visibility
,
defining
=
scope
is
not
None
)
self
.
sue_entries
.
append
(
entry
)
self
.
sue_entries
.
append
(
entry
)
...
@@ -639,7 +643,7 @@ class Scope(object):
...
@@ -639,7 +643,7 @@ class Scope(object):
def
declare_inherited_attributes
(
entry
,
base_classes
):
def
declare_inherited_attributes
(
entry
,
base_classes
):
for
base_class
in
base_classes
:
for
base_class
in
base_classes
:
if
base_class
is
PyrexTypes
.
error_type
:
if
base_class
is
PyrexTypes
.
error_type
or
base_class
is
PyrexTypes
.
cy_object_type
:
continue
continue
if
base_class
.
scope
is
None
:
if
base_class
.
scope
is
None
:
error
(
pos
,
"Cannot inherit from incomplete type"
)
error
(
pos
,
"Cannot inherit from incomplete type"
)
...
@@ -2465,6 +2469,8 @@ class CppClassScope(Scope):
...
@@ -2465,6 +2469,8 @@ class CppClassScope(Scope):
type
.
return_type
=
PyrexTypes
.
c_void_type
type
.
return_type
=
PyrexTypes
.
c_void_type
if
name
in
(
'<init>'
,
'<del>'
)
and
type
.
nogil
:
if
name
in
(
'<init>'
,
'<del>'
)
and
type
.
nogil
:
for
base
in
self
.
type
.
base_classes
:
for
base
in
self
.
type
.
base_classes
:
if
base
is
cy_object_type
:
continue
base_entry
=
base
.
scope
.
lookup
(
name
)
base_entry
=
base
.
scope
.
lookup
(
name
)
if
base_entry
and
not
base_entry
.
type
.
nogil
:
if
base_entry
and
not
base_entry
.
type
.
nogil
:
error
(
pos
,
"Constructor cannot be called without GIL unless all base constructors can also be called without GIL"
)
error
(
pos
,
"Constructor cannot be called without GIL unless all base constructors can also be called without GIL"
)
...
...
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