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
Xavier Thompson
cython
Commits
ed0ba259
Commit
ed0ba259
authored
Apr 29, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cypclass generation in ModuleNode (with virtual inheritance)
parent
fe702968
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+10
-4
No files found.
Cython/Compiler/ModuleNode.py
View file @
ed0ba259
...
...
@@ -6,7 +6,7 @@ from __future__ import absolute_import
import
cython
cython
.
declare
(
Naming
=
object
,
Options
=
object
,
PyrexTypes
=
object
,
TypeSlots
=
object
,
error
=
object
,
warning
=
object
,
py_object_type
=
object
,
UtilityCode
=
object
,
error
=
object
,
warning
=
object
,
py_object_type
=
object
,
cy_object_type
=
object
,
UtilityCode
=
object
,
EncodedString
=
object
,
re
=
object
)
from
collections
import
defaultdict
...
...
@@ -27,7 +27,7 @@ from . import PyrexTypes
from
.
import
Pythran
from
.Errors
import
error
,
warning
from
.PyrexTypes
import
py_object_type
from
.PyrexTypes
import
py_object_type
,
cy_object_type
from
..Utils
import
open_new_file
,
replace_suffix
,
decode_filename
,
build_hex_version
from
.Code
import
UtilityCode
,
IncludeCode
from
.StringEncoding
import
EncodedString
...
...
@@ -908,8 +908,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# Just let everything be public.
code
.
put
(
"struct %s"
%
type
.
cname
)
if
type
.
base_classes
:
base_class_decl
=
", public "
.
join
(
[
base_class
.
empty_declaration_code
()
for
base_class
in
type
.
base_classes
])
base_class_list
=
[
base_class
.
empty_declaration_code
()
for
base_class
in
type
.
base_classes
]
if
type
.
is_cyp_class
and
type
.
base_classes
[
-
1
]
is
cy_object_type
:
base_class_list
[
-
1
]
=
"virtual "
+
base_class_list
[
-
1
]
base_class_decl
=
", public "
.
join
(
base_class_list
)
code
.
put
(
" : public %s"
%
base_class_decl
)
code
.
putln
(
" {"
)
self
.
generate_type_header_code
(
scope
.
type_entries
,
code
)
...
...
@@ -1012,6 +1014,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"%s& operator=(const %s& __Pyx_other);"
%
(
type
.
cname
,
type
.
cname
))
code
.
putln
(
"};"
)
if
type
.
is_cyp_class
:
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"CythonReferenceCounting"
,
"ObjectHandling.c"
))
def
generate_enum_definition
(
self
,
entry
,
code
):
code
.
mark_pos
(
entry
.
pos
)
type
=
entry
.
type
...
...
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