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
e693cca4
Commit
e693cca4
authored
Feb 21, 2015
by
Kevin Modzelewski
Committed by
Travis Hance
Feb 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Have type analysis use new scoping API
parent
29ac7b5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
src/analysis/type_analysis.cpp
src/analysis/type_analysis.cpp
+24
-10
No files found.
src/analysis/type_analysis.cpp
View file @
e693cca4
...
...
@@ -394,7 +394,9 @@ private:
}
void
*
visit_name
(
AST_Name
*
node
)
override
{
if
(
scope_info
->
refersToGlobal
(
node
->
id
))
{
auto
name_scope
=
scope_info
->
getScopeTypeOfName
(
node
->
id
);
if
(
name_scope
==
ScopeInfo
::
VarScopeType
::
GLOBAL
)
{
if
(
node
->
id
.
str
()
==
"xrange"
)
{
// printf("TODO guard here and return the classobj\n");
// return typeOfClassobj(xrange_cls);
...
...
@@ -402,10 +404,19 @@ private:
return
UNKNOWN
;
}
if
(
scope_info
->
refersToClosure
(
node
->
id
)
)
{
if
(
name_scope
==
ScopeInfo
::
VarScopeType
::
CLOSURE
)
{
return
UNKNOWN
;
}
if
(
name_scope
==
ScopeInfo
::
VarScopeType
::
NAME
)
{
return
UNKNOWN
;
}
if
(
name_scope
==
ScopeInfo
::
VarScopeType
::
DEREF
)
{
return
UNKNOWN
;
}
if
(
name_scope
==
ScopeInfo
::
VarScopeType
::
FAST
)
{
CompilerType
*&
t
=
sym_table
[
node
->
id
];
if
(
t
==
NULL
)
{
// if (VERBOSITY() >= 2) {
...
...
@@ -417,6 +428,9 @@ private:
return
t
;
}
RELEASE_ASSERT
(
0
,
"Unknown scope type: %d"
,
(
int
)
name_scope
);
}
void
*
visit_num
(
AST_Num
*
node
)
override
{
switch
(
node
->
num_type
)
{
case
AST_Num
:
:
INT
:
...
...
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