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
5b9d3022
Commit
5b9d3022
authored
Apr 21, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaned up lambda cname mangeling by moving it into the Scope class
parent
e4a910d0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-8
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+8
-2
No files found.
Cython/Compiler/Nodes.py
View file @
5b9d3022
...
@@ -2232,14 +2232,7 @@ class DefNode(FuncDefNode):
...
@@ -2232,14 +2232,7 @@ class DefNode(FuncDefNode):
entry
.
doc
=
None
entry
.
doc
=
None
def
declare_lambda_function
(
self
,
env
):
def
declare_lambda_function
(
self
,
env
):
name
=
self
.
name
entry
=
env
.
declare_lambda_function
(
self
.
lambda_name
,
self
.
pos
)
prefix
=
env
.
scope_prefix
func_cname
=
\
Naming
.
lambda_func_prefix
+
u'funcdef'
+
prefix
+
self
.
lambda_name
entry
=
env
.
declare_lambda_function
(
func_cname
,
self
.
pos
)
entry
.
pymethdef_cname
=
\
Naming
.
lambda_func_prefix
+
u'methdef'
+
prefix
+
self
.
lambda_name
entry
.
qualified_name
=
env
.
qualify_name
(
self
.
lambda_name
)
entry
.
doc
=
None
entry
.
doc
=
None
self
.
entry
=
entry
self
.
entry
=
entry
...
...
Cython/Compiler/Symtab.py
View file @
5b9d3022
...
@@ -556,10 +556,16 @@ class Scope(object):
...
@@ -556,10 +556,16 @@ class Scope(object):
entry.is_anonymous = True
entry.is_anonymous = True
return entry
return entry
def declare_lambda_function(self,
func_c
name, pos):
def declare_lambda_function(self,
lambda_
name, pos):
# Add an entry for an anonymous Python function.
# Add an entry for an anonymous Python function.
func_cname = self.mangle(Naming.lambda_func_prefix + u'funcdef_', lambda_name)
pymethdef_cname = self.mangle(Naming.lambda_func_prefix + u'methdef_', lambda_name)
qualified_name = self.qualify_name(lambda_name)
entry = self.declare(None, func_cname, py_object_type, pos, 'private')
entry = self.declare(None, func_cname, py_object_type, pos, 'private')
entry.name = EncodedString(func_cname)
entry.name = lambda_name
entry.qualified_name = qualified_name
entry.pymethdef_cname = pymethdef_cname
entry.func_cname = func_cname
entry.func_cname = func_cname
entry.signature = pyfunction_signature
entry.signature = pyfunction_signature
entry.is_anonymous = True
entry.is_anonymous = True
...
...
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