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
a09bcba9
Commit
a09bcba9
authored
Feb 20, 2015
by
Travis Hance
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commented out functionality of eval test that doesn't work
parent
85ceebb5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
26 deletions
+26
-26
src/codegen/irgen/hooks.cpp
src/codegen/irgen/hooks.cpp
+1
-1
src/codegen/parser.cpp
src/codegen/parser.cpp
+1
-1
test/tests/eval_test.py
test/tests/eval_test.py
+24
-24
No files found.
src/codegen/irgen/hooks.cpp
View file @
a09bcba9
...
@@ -317,7 +317,7 @@ static Box* compileAndRunExpression(AST_Expression* expr, BoxedModule* bm) {
...
@@ -317,7 +317,7 @@ static Box* compileAndRunExpression(AST_Expression* expr, BoxedModule* bm) {
SourceInfo
*
si
=
new
SourceInfo
(
bm
,
scoping
,
expr
,
{
stmt
});
SourceInfo
*
si
=
new
SourceInfo
(
bm
,
scoping
,
expr
,
{
stmt
});
CLFunction
*
cl_f
=
new
CLFunction
(
0
,
0
,
false
,
false
,
si
);
CLFunction
*
cl_f
=
new
CLFunction
(
0
,
0
,
false
,
false
,
si
);
EffortLevel
::
EffortLevel
effort
=
initialEffort
();
EffortLevel
effort
=
initialEffort
();
cf
=
compileFunction
(
cl_f
,
new
FunctionSpecialization
(
VOID
),
effort
,
NULL
);
cf
=
compileFunction
(
cl_f
,
new
FunctionSpecialization
(
VOID
),
effort
,
NULL
);
assert
(
cf
->
clfunc
->
versions
.
size
());
assert
(
cf
->
clfunc
->
versions
.
size
());
...
...
src/codegen/parser.cpp
View file @
a09bcba9
...
@@ -1089,7 +1089,7 @@ AST_Module* caching_parse_file(const char* fn) {
...
@@ -1089,7 +1089,7 @@ AST_Module* caching_parse_file(const char* fn) {
if
(
result
==
ParseResult
::
PYC_UNWRITABLE
)
{
if
(
result
==
ParseResult
::
PYC_UNWRITABLE
)
{
if
(
VERBOSITY
())
if
(
VERBOSITY
())
printf
(
"Unable to write to %s, falling back to non-caching parse
\n
"
,
cache_fn
.
c_str
());
printf
(
"Unable to write to %s, falling back to non-caching parse
\n
"
,
cache_fn
.
c_str
());
return
parse
(
fn
);
return
parse
_file
(
fn
);
}
}
code
=
stat
(
cache_fn
.
c_str
(),
&
cache_stat
);
code
=
stat
(
cache_fn
.
c_str
(),
&
cache_stat
);
assert
(
code
==
0
);
assert
(
code
==
0
);
...
...
test/tests/eval_test.py
View file @
a09bcba9
# expected: fail
# lots of eval functionality not implemented
# - eval not implemented
# - closures not implemented
print
eval
(
"3 + 4"
)
print
eval
(
"3 + 4"
)
a
=
5
a
=
5
print
eval
(
"a"
)
print
eval
(
"a"
)
print
eval
(
"[b for b in range(5)]"
)
#
print eval("[b for b in range(5)]")
print
b
#
print b
c
=
2
#
c = 2
print
eval
(
"[c for c in range(5)]"
)
#
print eval("[c for c in range(5)]")
print
c
#
print c
try
:
#
try:
print
eval
(
"int('abc')"
)
#
print eval("int('abc')")
except
ValueError
:
#
except ValueError:
print
'got ValueError'
#
print 'got ValueError'
d
=
19
d
=
19
e
=
20
e
=
20
...
@@ -47,24 +45,24 @@ def func():
...
@@ -47,24 +45,24 @@ def func():
eval
(
"[h for h in range(5)]"
)
eval
(
"[h for h in range(5)]"
)
print
h
print
h
h2
=
2
#
h2 = 2
print
eval
(
"h2 + sum([h2 for h2 in range(5)])"
)
#
print eval("h2 + sum([h2 for h2 in range(5)])")
print
'h2'
,
h2
#
print 'h2', h2
h3
=
2
#
h3 = 2
print
eval
(
"sum([h3 for h3 in range(5)]) + h3"
)
#
print eval("sum([h3 for h3 in range(5)]) + h3")
print
'h3'
,
h3
#
print 'h3', h3
eval
(
"[i for i in range(5)]"
)
eval
(
"[i for i in range(5)]"
)
j
=
24
#
j = 24
def
inner
():
#
def inner():
return
j
#
return j
print
eval
(
"inner()"
)
#
print eval("inner()")
func
()
func
()
print
i
print
i
print
eval
(
"(lambda k : k+2)(3)"
)
#
print eval("(lambda k : k+2)(3)")
l
=
100
l
=
100
print
eval
(
"(lambda k : l+2)(3)"
)
print
eval
(
"(lambda k : l+2)(3)"
)
...
@@ -83,8 +81,9 @@ print eval("eval('3 + 2342')")
...
@@ -83,8 +81,9 @@ print eval("eval('3 + 2342')")
o
=
300
o
=
300
print
'eval eval o'
,
eval
(
"eval('o')"
)
print
'eval eval o'
,
eval
(
"eval('o')"
)
print
eval
(
"[(lambda p : p + o)(5) for o in range(5)]"
)
#
print eval("[(lambda p : p + o)(5) for o in range(5)]")
"""
shadow1 = 1000
shadow1 = 1000
shadow2 = 1000
shadow2 = 1000
shadow3 = 1000
shadow3 = 1000
...
@@ -123,3 +122,4 @@ def wrap():
...
@@ -123,3 +122,4 @@ def wrap():
inner2()
inner2()
wrap()
wrap()
"""
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