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
94be1d80
Commit
94be1d80
authored
Jun 06, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix inplace operators for 0.9.5.1a
parent
25194156
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+9
-6
No files found.
Cython/Compiler/Nodes.py
View file @
94be1d80
...
...
@@ -1587,24 +1587,26 @@ class InPlaceAssignmentNode(AssignmentNode):
def
analyse_declarations
(
self
,
env
):
self
.
lhs
.
analyse_target_declaration
(
env
)
def
analyse_
expressions_1
(
self
,
env
,
use_temp
=
0
):
def
analyse_
types
(
self
,
env
):
import
ExprNodes
self
.
create_dup_node
(
env
)
# re-assigns lhs to a shallow copy
self
.
dup
=
self
.
create_dup_node
(
env
)
# re-assigns lhs to a shallow copy
self
.
rhs
.
analyse_types
(
env
)
self
.
lhs
.
analyse_target_types
(
env
)
def
allocate_rhs_temps
(
self
,
env
):
if
self
.
lhs
.
type
.
is_pyobject
or
self
.
rhs
.
type
.
is_pyobject
:
self
.
rhs
=
self
.
rhs
.
coerce_to
(
self
.
lhs
.
type
,
env
)
if
self
.
lhs
.
type
.
is_pyobject
:
self
.
result
=
ExprNodes
.
PyTempNode
(
self
.
pos
,
env
)
self
.
result
.
allocate_temps
(
env
)
if
use_temp
:
self
.
rhs
=
self
.
rhs
.
coerce_to_temp
(
env
)
#
if use_temp:
#
self.rhs = self.rhs.coerce_to_temp(env)
self
.
rhs
.
allocate_temps
(
env
)
self
.
dup
.
allocate_subexpr_temps
(
env
)
self
.
dup
.
allocate_temp
(
env
)
def
a
nalyse_expressions_2
(
self
,
env
):
def
a
llocate_lhs_temps
(
self
,
env
):
self
.
lhs
.
allocate_target_temps
(
env
)
self
.
lhs
.
release_target_temp
(
env
)
self
.
dup
.
release_temp
(
env
)
...
...
@@ -1648,6 +1650,7 @@ class InPlaceAssignmentNode(AssignmentNode):
elif
isinstance
(
self
.
lhs
,
ExprNodes
.
IndexNode
):
target_lhs
=
ExprNodes
.
IndexNode
(
self
.
dup
.
pos
,
base
=
ExprNodes
.
CloneNode
(
self
.
dup
.
base
),
index
=
ExprNodes
.
CloneNode
(
self
.
lhs
.
index
),
is_temp
=
self
.
dup
.
is_temp
)
self
.
lhs
=
target_lhs
return
self
.
dup
def
py_operation_function
(
self
):
return
self
.
py_functions
[
self
.
operator
]
...
...
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