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
1ae591fa
Commit
1ae591fa
authored
Oct 07, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
call struct constructor
parent
9534cbd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+19
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
1ae591fa
...
@@ -1862,6 +1862,21 @@ class CallNode(ExprNode):
...
@@ -1862,6 +1862,21 @@ class CallNode(ExprNode):
# Make sure we're not in a nogil environment
# Make sure we're not in a nogil environment
if
env
.
nogil
:
if
env
.
nogil
:
error
(
self
.
pos
,
"Calling gil-requiring function without gil"
)
error
(
self
.
pos
,
"Calling gil-requiring function without gil"
)
def
analyse_as_type_constructor
(
self
,
env
):
type
=
self
.
function
.
analyse_as_type
(
env
)
if
type
and
type
.
is_struct_or_union
:
args
,
kwds
=
self
.
explicit_args_kwds
()
items
=
[]
for
arg
,
member
in
zip
(
args
,
type
.
scope
.
var_entries
):
items
.
append
(
DictItemNode
(
pos
=
arg
.
pos
,
key
=
NameNode
(
pos
=
arg
.
pos
,
name
=
member
.
name
),
value
=
arg
))
if
kwds
:
items
+=
kwds
.
key_value_pairs
self
.
key_value_pairs
=
items
self
.
__class__
=
DictNode
self
.
analyse_types
(
env
)
self
.
coerce_to
(
type
,
env
)
return
True
class
SimpleCallNode
(
CallNode
):
class
SimpleCallNode
(
CallNode
):
...
@@ -1907,6 +1922,8 @@ class SimpleCallNode(CallNode):
...
@@ -1907,6 +1922,8 @@ class SimpleCallNode(CallNode):
return
self
.
args
,
None
return
self
.
args
,
None
def
analyse_types
(
self
,
env
):
def
analyse_types
(
self
,
env
):
if
self
.
analyse_as_type_constructor
(
env
):
return
function
=
self
.
function
function
=
self
.
function
function
.
is_called
=
1
function
.
is_called
=
1
self
.
function
.
analyse_types
(
env
)
self
.
function
.
analyse_types
(
env
)
...
@@ -2142,6 +2159,8 @@ class GeneralCallNode(CallNode):
...
@@ -2142,6 +2159,8 @@ class GeneralCallNode(CallNode):
return
self
.
positional_args
.
args
,
self
.
keyword_args
return
self
.
positional_args
.
args
,
self
.
keyword_args
def
analyse_types
(
self
,
env
):
def
analyse_types
(
self
,
env
):
if
self
.
analyse_as_type_constructor
(
env
):
return
self
.
function
.
analyse_types
(
env
)
self
.
function
.
analyse_types
(
env
)
self
.
positional_args
.
analyse_types
(
env
)
self
.
positional_args
.
analyse_types
(
env
)
if
self
.
keyword_args
:
if
self
.
keyword_args
:
...
...
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