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
f121187a
Commit
f121187a
authored
Mar 21, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow c++ nested class definitions
parent
1ad402ca
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 @
f121187a
...
@@ -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 @
f121187a
...
@@ -1509,6 +1509,9 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode):
...
@@ -1509,6 +1509,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