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
1b064489
Commit
1b064489
authored
Jul 10, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
latest 0.9.4 changes into 0.9.5 branch
parents
ca2d577d
eb1857fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+24
-1
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+1
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+9
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
1b064489
...
...
@@ -1877,6 +1877,27 @@ class SequenceNode(ExprNode):
self
.
generate_operation_code
(
code
)
def
generate_assignment_code
(
self
,
rhs
,
code
):
code
.
putln
(
"if (PyTuple_CheckExact(%s) && PyTuple_GET_SIZE(%s) == %s) {"
%
(
rhs
.
py_result
(),
rhs
.
py_result
(),
len
(
self
.
args
)))
for
i
in
range
(
len
(
self
.
args
)):
item
=
self
.
unpacked_items
[
i
]
code
.
putln
(
"%s = PyTuple_GET_ITEM(%s, %s);"
%
(
item
.
result_code
,
rhs
.
py_result
(),
i
))
code
.
put_incref
(
item
.
result_code
,
item
.
ctype
())
value_node
=
self
.
coerced_unpacked_items
[
i
]
value_node
.
generate_evaluation_code
(
code
)
self
.
args
[
i
].
generate_assignment_code
(
value_node
,
code
)
rhs
.
generate_disposal_code
(
code
)
code
.
putln
(
"}"
)
code
.
putln
(
"else {"
)
code
.
putln
(
"%s = PyObject_GetIter(%s); if (!%s) %s"
%
(
self
.
iterator
.
result_code
,
...
...
@@ -1903,9 +1924,11 @@ class SequenceNode(ExprNode):
code
.
error_goto
(
self
.
pos
)))
if
debug_disposal_code
:
print
"UnpackNode.generate_assignment_code:"
print
"...generating disposal code for"
,
rhs
print
"...generating disposal code for"
,
iterator
self
.
iterator
.
generate_disposal_code
(
code
)
code
.
putln
(
"}"
)
class
TupleNode
(
SequenceNode
):
# Tuple constructor.
...
...
Cython/Compiler/Parsing.py
View file @
1b064489
...
...
@@ -1497,7 +1497,7 @@ def p_c_arg_list(s, in_pyfunc, cmethod_flag = 0):
args
.
append
(
p_c_arg_decl
(
s
,
in_pyfunc
,
cmethod_flag
))
while
s
.
sy
==
','
:
s
.
next
()
if
s
.
sy
in
c_arg_list_t
raile
rs
:
if
s
.
sy
in
c_arg_list_t
erminato
rs
:
break
args
.
append
(
p_c_arg_decl
(
s
,
in_pyfunc
))
return
args
...
...
Cython/Compiler/PyrexTypes.py
View file @
1b064489
...
...
@@ -647,6 +647,15 @@ class CStructOrUnionType(CType):
base
=
"%s %s"
%
(
self
.
kind
,
self
.
cname
)
return
"%s %s"
%
(
public_decl
(
base
,
dll_linkage
),
entity_code
)
def
__cmp__
(
self
,
other
):
try
:
if
self
.
name
==
other
.
name
:
return
0
else
:
return
1
except
AttributeError
:
return
1
def
is_complete
(
self
):
return
self
.
scope
is
not
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