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
c5ce74b8
Commit
c5ce74b8
authored
Sep 18, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish class members
parent
598b2537
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+5
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+10
-2
No files found.
Cython/Compiler/Nodes.py
View file @
c5ce74b8
...
...
@@ -1371,7 +1371,11 @@ class CClassDefNode(StatNode):
def
analyse_expressions
(
self
,
env
):
if
self
.
body
:
self
.
body
.
analyse_expressions
(
env
)
scope
=
self
.
entry
.
type
.
scope
print
"env"
,
env
print
"scope"
,
scope
print
scope
.
outer_scope
self
.
body
.
analyse_expressions
(
scope
)
def
generate_function_definitions
(
self
,
env
,
code
):
if
self
.
body
:
...
...
Cython/Compiler/Symtab.py
View file @
c5ce74b8
...
...
@@ -342,6 +342,7 @@ class Scope:
error
(
pos
,
"'%s' is not declared"
%
name
)
def
lookup
(
self
,
name
):
print
"looking up"
,
name
,
"in"
,
self
# Look up name in this scope or an enclosing one.
# Return None if not found.
return
(
self
.
lookup_here
(
name
)
...
...
@@ -977,6 +978,13 @@ class ClassScope(Scope):
def
add_string_const
(
self
,
value
):
return
self
.
outer_scope
.
add_string_const
(
value
)
def
lookup
(
self
,
name
):
print
"*** Looking for"
,
name
,
"in ClassScope"
,
self
print
self
.
entries
res
=
Scope
.
lookup
(
self
,
name
)
print
"got"
,
res
,
res
.
type
return
res
class
PyClassScope
(
ClassScope
):
# Namespace of a Python class.
...
...
@@ -1099,7 +1107,7 @@ class CClassScope(ClassScope):
if
name
in
(
'__eq__'
,
'__ne__'
,
'__lt__'
,
'__gt__'
,
'__le__'
,
'__ge__'
):
error
(
pos
,
"Special method %s must be implemented via __richcmp__"
%
name
)
entry
=
self
.
declare
(
name
,
name
,
py_object_type
,
pos
)
entry
=
self
.
declare
_var
(
name
,
py_object_type
,
pos
)
special_sig
=
get_special_method_signature
(
name
)
if
special_sig
:
# Special methods get put in the method table with a particular
...
...
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