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
d4ae5f87
Commit
d4ae5f87
authored
Jun 19, 2019
by
gsamain
Committed by
Xavier Thompson
Jun 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid implicit _passive_self hiding when inheriting Activated bases by using class_related names
parent
1f6197ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+6
-4
No files found.
Cython/Compiler/ModuleNode.py
View file @
d4ae5f87
...
...
@@ -1212,6 +1212,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
result_attr_cname
=
"_active_result_class"
queue_attr_cname
=
"_active_queue_class"
passive_self_attr_cname
=
Naming
.
builtin_prefix
+
entry
.
type
.
empty_declaration_code
().
replace
(
'::'
,
'__'
)
+
"_passive_self"
activable_bases_cnames
=
[
base
.
cname
for
base
in
entry
.
type
.
base_classes
if
base
.
activable
]
activable_bases_inheritance_list
=
[
"public %s::Activated"
%
cname
for
cname
in
activable_bases_cnames
]
...
...
@@ -1222,14 +1223,15 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
base_classes_code
=
"public ActhonActivableClass"
initialize_code
=
"ActhonActivableClass(active_queue, active_result_constructor)"
code
.
putln
(
"struct %s::Activated : %s {"
%
(
entry
.
type
.
empty_declaration_code
(),
base_classes_code
))
code
.
putln
(
"%s
* _passive_self;"
%
entry
.
type
.
empty_declaration_code
(
))
code
.
putln
(
"%s
;"
%
entry
.
type
.
declaration_code
(
passive_self_attr_cname
))
code
.
putln
((
"Activated(%s * passive_object, %s, %s)"
": %s,
_passive_self
(passive_object){} // Used by _passive_self.__activate__()"
": %s,
%s
(passive_object){} // Used by _passive_self.__activate__()"
%
(
entry
.
type
.
empty_declaration_code
(),
queue_interface_type
.
declaration_code
(
"active_queue"
),
entry
.
type
.
scope
.
lookup_here
(
"__activate__"
).
type
.
args
[
1
].
type
.
declaration_code
(
"active_result_constructor"
),
initialize_code
initialize_code
,
passive_self_attr_cname
)
))
for
reifying_class_entry
in
entry
.
type
.
scope
.
reifying_entries
:
...
...
@@ -1254,7 +1256,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"%s {"
%
function_code
)
code
.
putln
(
"%s = this->%s();"
%
(
result_interface_type
.
declaration_code
(
"result_object"
),
result_attr_cname
))
message_constructor_args_list
=
[
"this->
_passive_self"
,
"sync_object"
,
"result_object"
]
+
reified_arg_cname_list
message_constructor_args_list
=
[
"this->
%s"
%
passive_self_attr_cname
,
"sync_object"
,
"result_object"
]
+
reified_arg_cname_list
message_constructor_args_code
=
", "
.
join
(
message_constructor_args_list
)
code
.
putln
(
"%s = new %s(%s);"
%
(
reifying_class_entry
.
type
.
declaration_code
(
"message"
),
...
...
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