Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
2606f3b9
Commit
2606f3b9
authored
Mar 18, 2015
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mangle functiondef and classdef names in the type analysis
parent
4b51f74e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
src/analysis/type_analysis.cpp
src/analysis/type_analysis.cpp
+5
-2
test/tests/name_mangling.py
test/tests/name_mangling.py
+10
-0
No files found.
src/analysis/type_analysis.cpp
View file @
2606f3b9
...
...
@@ -522,7 +522,7 @@ private:
// TODO should we speculate that classdefs will generally return a class?
// CompilerType* t = typeFromClass(type_cls);
CompilerType
*
t
=
UNKNOWN
;
_doSet
(
node
->
name
,
t
);
_doSet
(
scope_info
->
mangleName
(
node
->
name
)
,
t
);
}
void
visit_delete
(
AST_Delete
*
node
)
override
{
...
...
@@ -559,7 +559,10 @@ private:
getType
(
d
);
}
_doSet
(
node
->
name
,
typeFromClass
(
function_cls
));
CompilerType
*
t
=
UNKNOWN
;
if
(
node
->
decorator_list
.
empty
())
t
=
typeFromClass
(
function_cls
);
_doSet
(
scope_info
->
mangleName
(
node
->
name
),
t
);
}
void
visit_global
(
AST_Global
*
node
)
override
{}
...
...
test/tests/name_mangling.py
View file @
2606f3b9
...
...
@@ -156,3 +156,13 @@ print _MyClass._MyClass__a
class
___
(
object
):
__a
=
2
print
___
.
__a
# this fails if the type analysis does not mangle the function name
class
C
():
def
f
():
def
__f2
():
print
"hi"
if
1
:
pass
f
()
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