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
68592200
Commit
68592200
authored
Feb 02, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
<type?> does type check for extension types
parent
9eecd7bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-0
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+7
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
68592200
...
...
@@ -2617,6 +2617,9 @@ class TypecastNode(ExprNode):
self
.
operand
=
self
.
operand
.
coerce_to
(
self
.
type
,
env
)
else
:
warning
(
self
.
pos
,
"No conversion from %s to %s, python object pointer used."
%
(
self
.
type
,
self
.
operand
.
type
))
elif
from_py
and
to_py
:
if
self
.
typecheck
and
self
.
type
.
is_extension_type
:
self
.
operand
=
PyTypeTestNode
(
self
.
operand
,
self
.
type
,
env
)
def
check_const
(
self
):
self
.
operand
.
check_const
()
...
...
Cython/Compiler/Parsing.py
View file @
68592200
...
...
@@ -207,12 +207,18 @@ def p_typecast(s):
s
.
next
()
base_type
=
p_c_base_type
(
s
)
declarator
=
p_c_declarator
(
s
,
empty
=
1
)
if
s
.
sy
==
'?'
:
s
.
next
()
typecheck
=
1
else
:
typecheck
=
0
s
.
expect
(
">"
)
operand
=
p_factor
(
s
)
return
ExprNodes
.
TypecastNode
(
pos
,
base_type
=
base_type
,
declarator
=
declarator
,
operand
=
operand
)
operand
=
operand
,
typecheck
=
typecheck
)
def
p_sizeof
(
s
):
# s.sy == ident "sizeof"
...
...
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