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
45ce500e
Commit
45ce500e
authored
Jul 13, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make __call__ work for cypclasses
parent
52c0b223
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+6
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+2
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
45ce500e
...
@@ -5807,6 +5807,7 @@ class SimpleCallNode(CallNode):
...
@@ -5807,6 +5807,7 @@ class SimpleCallNode(CallNode):
# rlocked bool used internally
# rlocked bool used internally
# wlocked bool used internally
# wlocked bool used internally
# tracked_state bool used internally
# tracked_state bool used internally
# needs_deref bool used internally
subexprs
=
[
'self'
,
'coerced_self'
,
'function'
,
'args'
,
'arg_tuple'
]
subexprs
=
[
'self'
,
'coerced_self'
,
'function'
,
'args'
,
'arg_tuple'
]
...
@@ -5822,6 +5823,7 @@ class SimpleCallNode(CallNode):
...
@@ -5822,6 +5823,7 @@ class SimpleCallNode(CallNode):
rlocked
=
False
rlocked
=
False
wlocked
=
False
wlocked
=
False
tracked_state
=
True
# Something random, anything that is not None
tracked_state
=
True
# Something random, anything that is not None
needs_deref
=
False
def
compile_time_value
(
self
,
denv
):
def
compile_time_value
(
self
,
denv
):
function
=
self
.
function
.
compile_time_value
(
denv
)
function
=
self
.
function
.
compile_time_value
(
denv
)
...
@@ -5981,6 +5983,8 @@ class SimpleCallNode(CallNode):
...
@@ -5981,6 +5983,8 @@ class SimpleCallNode(CallNode):
entry
.
used
=
True
entry
.
used
=
True
if
not
func_type
.
is_cpp_class
:
if
not
func_type
.
is_cpp_class
:
self
.
function
.
entry
=
entry
self
.
function
.
entry
=
entry
elif
func_type
.
is_cyp_class
:
self
.
needs_deref
=
True
self
.
function
.
type
=
entry
.
type
self
.
function
.
type
=
entry
.
type
func_type
=
self
.
function_type
()
func_type
=
self
.
function_type
()
else
:
else
:
...
@@ -6242,6 +6246,8 @@ class SimpleCallNode(CallNode):
...
@@ -6242,6 +6246,8 @@ class SimpleCallNode(CallNode):
# argument. This is the opposite of self.self purpose.
# argument. This is the opposite of self.self purpose.
if
self
.
explicit_cpp_self
:
if
self
.
explicit_cpp_self
:
result
=
"%s->%s(%s)"
%
(
self
.
explicit_cpp_self
,
self
.
function
.
result
(),
', '
.
join
(
arg_list_code
))
result
=
"%s->%s(%s)"
%
(
self
.
explicit_cpp_self
,
self
.
function
.
result
(),
', '
.
join
(
arg_list_code
))
elif
self
.
needs_deref
:
result
=
"(*%s)(%s)"
%
(
self
.
function
.
result
(),
', '
.
join
(
arg_list_code
))
else
:
else
:
result
=
"%s(%s)"
%
(
self
.
function
.
result
(),
', '
.
join
(
arg_list_code
))
result
=
"%s(%s)"
%
(
self
.
function
.
result
(),
', '
.
join
(
arg_list_code
))
return
result
return
result
...
...
Cython/Compiler/Symtab.py
View file @
45ce500e
...
@@ -2793,7 +2793,8 @@ class CppClassScope(Scope):
...
@@ -2793,7 +2793,8 @@ class CppClassScope(Scope):
'__lt__'
:
'<'
,
'__lt__'
:
'<'
,
'__gt__'
:
'>'
,
'__gt__'
:
'>'
,
'__le__'
:
'<='
,
'__le__'
:
'<='
,
'__ge__'
:
'>='
'__ge__'
:
'>='
,
'__call__'
:
'()'
}
}
def
__init__
(
self
,
name
,
outer_scope
,
templates
=
None
):
def
__init__
(
self
,
name
,
outer_scope
,
templates
=
None
):
...
...
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