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
Boxiang Sun
cython
Commits
cbcbdc0c
Commit
cbcbdc0c
authored
Oct 10, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor bug fixes
parent
e352a0b3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+2
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+12
-7
Cython/Compiler/Parsing.py
Cython/Compiler/Parsing.py
+1
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
cbcbdc0c
...
...
@@ -1678,6 +1678,8 @@ class AttributeNode(ExprNode):
entry
=
None
if
obj_type
.
attributes_known
():
entry
=
obj_type
.
scope
.
lookup_here
(
self
.
attribute
)
if
entry
and
entry
.
is_member
:
entry
=
None
else
:
error
(
self
.
pos
,
"Cannot select attribute of incomplete type '%s'"
...
...
Cython/Compiler/Nodes.py
View file @
cbcbdc0c
...
...
@@ -684,7 +684,7 @@ class FuncDefNode(StatNode, BlockNode):
class
CFuncDefNode
(
FuncDefNode
):
# C function definition.
#
# modifiers
'inline ' or 'visible' or 'overrideable'
# modifiers
['inline']
# visibility 'private' or 'public' or 'extern'
# base_type CBaseTypeNode
# declarator CDeclaratorNode
...
...
@@ -766,7 +766,7 @@ class CFuncDefNode(FuncDefNode):
storage_class
=
"%s "
%
Naming
.
extern_c_macro
else
:
storage_class
=
""
code
.
putln
(
"%s%s%s {"
%
(
code
.
putln
(
"%s%s
%s {"
%
(
storage_class
,
' '
.
join
(
self
.
modifiers
).
upper
(),
# macro forms
header
))
...
...
@@ -1003,13 +1003,14 @@ class DefNode(FuncDefNode):
self
.
synthesize_assignment_node
(
env
)
def
analyse_default_values
(
self
,
env
):
genv
=
env
.
global_scope
()
for
arg
in
self
.
args
:
if
arg
.
default
:
if
arg
.
is_generic
:
arg
.
default
.
analyse_types
(
env
)
arg
.
default
=
arg
.
default
.
coerce_to
(
arg
.
type
,
env
)
arg
.
default
.
allocate_temps
(
env
)
arg
.
default_entry
=
env
.
add_default_value
(
arg
.
type
)
arg
.
default
.
analyse_types
(
g
env
)
arg
.
default
=
arg
.
default
.
coerce_to
(
arg
.
type
,
g
env
)
arg
.
default
.
allocate_temps
(
g
env
)
arg
.
default_entry
=
g
env
.
add_default_value
(
arg
.
type
)
arg
.
default_entry
.
used
=
1
else
:
error
(
arg
.
pos
,
...
...
@@ -1222,8 +1223,12 @@ class DefNode(FuncDefNode):
old_type
=
arg
.
hdr_type
new_type
=
arg
.
type
if
old_type
.
is_pyobject
:
code
.
putln
(
"assert(%s);"
%
arg
.
hdr_cname
)
if
arg
.
default
:
code
.
putln
(
"if (%s) {"
%
arg
.
hdr_cname
)
else
:
code
.
putln
(
"assert(%s); {"
%
arg
.
hdr_cname
)
self
.
generate_arg_conversion_from_pyobject
(
arg
,
code
)
code
.
putln
(
"}"
)
elif
new_type
.
is_pyobject
:
self
.
generate_arg_conversion_to_pyobject
(
arg
,
code
)
else
:
...
...
Cython/Compiler/Parsing.py
View file @
cbcbdc0c
...
...
@@ -1209,9 +1209,9 @@ def p_statement(s, level, cdef_flag = 0, visibility = 'private'):
if
level
not
in
(
'module'
,
'module_pxd'
):
s
.
error
(
"ctypedef statement not allowed here"
)
return
p_ctypedef_statement
(
s
,
level
,
visibility
)
overridable
=
0
if
s
.
sy
==
'cdef'
:
cdef_flag
=
1
overridable
=
0
s
.
next
()
if
s
.
sy
==
'rdef'
:
cdef_flag
=
1
...
...
Cython/Compiler/Symtab.py
View file @
cbcbdc0c
...
...
@@ -1104,8 +1104,7 @@ class CClassScope(ClassScope):
def
declare_pyfunction
(
self
,
name
,
pos
):
# Add an entry for a method.
if
name
in
(
'__eq__'
,
'__ne__'
,
'__lt__'
,
'__gt__'
,
'__le__'
,
'__ge__'
):
error
(
pos
,
"Special method %s must be implemented via __richcmp__"
%
name
)
error
(
pos
,
"Special method %s must be implemented via __richcmp__"
%
name
)
entry
=
self
.
declare_var
(
name
,
py_object_type
,
pos
)
special_sig
=
get_special_method_signature
(
name
)
if
special_sig
:
...
...
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