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
ce8a1f14
Commit
ce8a1f14
authored
Mar 21, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow c++ nested class definitions
parent
5f18de5f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+3
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+3
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
ce8a1f14
...
@@ -831,7 +831,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -831,7 +831,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
def
generate_typedef
(
self
,
entry
,
code
):
def
generate_typedef
(
self
,
entry
,
code
):
base_type
=
entry
.
type
.
typedef_base_type
base_type
=
entry
.
type
.
typedef_base_type
if
base_type
.
is_numeric
:
enclosing_scope
=
entry
.
scope
if
base_type
.
is_numeric
and
not
enclosing_scope
.
is_cpp_class_scope
:
try
:
try
:
writer
=
code
.
globalstate
[
'numeric_typedefs'
]
writer
=
code
.
globalstate
[
'numeric_typedefs'
]
except
KeyError
:
except
KeyError
:
...
@@ -909,6 +910,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -909,6 +910,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
[
base_class
.
empty_declaration_code
()
for
base_class
in
type
.
base_classes
])
[
base_class
.
empty_declaration_code
()
for
base_class
in
type
.
base_classes
])
code
.
put
(
" : public %s"
%
base_class_decl
)
code
.
put
(
" : public %s"
%
base_class_decl
)
code
.
putln
(
" {"
)
code
.
putln
(
" {"
)
self
.
generate_type_header_code
(
scope
.
type_entries
,
code
)
py_attrs
=
[
e
for
e
in
scope
.
entries
.
values
()
py_attrs
=
[
e
for
e
in
scope
.
entries
.
values
()
if
e
.
type
.
is_pyobject
and
not
e
.
is_inherited
]
if
e
.
type
.
is_pyobject
and
not
e
.
is_inherited
]
has_virtual_methods
=
False
has_virtual_methods
=
False
...
...
Cython/Compiler/Nodes.py
View file @
ce8a1f14
...
@@ -1507,6 +1507,9 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode):
...
@@ -1507,6 +1507,9 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode):
elif
isinstance
(
attr
,
CompilerDirectivesNode
):
elif
isinstance
(
attr
,
CompilerDirectivesNode
):
for
sub_attr
in
func_attributes
(
attr
.
body
.
stats
):
for
sub_attr
in
func_attributes
(
attr
.
body
.
stats
):
yield
sub_attr
yield
sub_attr
elif
isinstance
(
attr
,
CppClassNode
):
for
sub_attr
in
func_attributes
(
attr
.
attributes
):
yield
sub_attr
if
self
.
attributes
is
not
None
:
if
self
.
attributes
is
not
None
:
if
self
.
in_pxd
and
not
env
.
in_cinclude
:
if
self
.
in_pxd
and
not
env
.
in_cinclude
:
self
.
entry
.
defined_in_pxd
=
1
self
.
entry
.
defined_in_pxd
=
1
...
...
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