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) {
SourceInfo
*
si
=
new
SourceInfo
(
bm
,
scoping
,
expr
,
{
stmt
});
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
);
assert
(
cf
->
clfunc
->
versions
.
size
());
...
...
src/codegen/parser.cpp
View file @
a09bcba9
...
...
@@ -1089,7 +1089,7 @@ AST_Module* caching_parse_file(const char* fn) {
if
(
result
==
ParseResult
::
PYC_UNWRITABLE
)
{
if
(
VERBOSITY
())
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
);
assert
(
code
==
0
);
...
...
test/tests/eval_test.py
View file @
a09bcba9
# expected: fail
# - eval not implemented
# - closures not implemented
# lots of eval functionality not implemented
print
eval
(
"3 + 4"
)
a
=
5
print
eval
(
"a"
)
print
eval
(
"[b for b in range(5)]"
)
print
b
#
print eval("[b for b in range(5)]")
#
print b
c
=
2
print
eval
(
"[c for c in range(5)]"
)
print
c
#
c = 2
#
print eval("[c for c in range(5)]")
#
print c
try
:
print
eval
(
"int('abc')"
)
except
ValueError
:
print
'got ValueError'
#
try:
#
print eval("int('abc')")
#
except ValueError:
#
print 'got ValueError'
d
=
19
e
=
20
...
...
@@ -47,24 +45,24 @@ def func():
eval
(
"[h for h in range(5)]"
)
print
h
h2
=
2
print
eval
(
"h2 + sum([h2 for h2 in range(5)])"
)
print
'h2'
,
h2
#
h2 = 2
#
print eval("h2 + sum([h2 for h2 in range(5)])")
#
print 'h2', h2
h3
=
2
print
eval
(
"sum([h3 for h3 in range(5)]) + h3"
)
print
'h3'
,
h3
#
h3 = 2
#
print eval("sum([h3 for h3 in range(5)]) + h3")
#
print 'h3', h3
eval
(
"[i for i in range(5)]"
)
j
=
24
def
inner
():
return
j
print
eval
(
"inner()"
)
#
j = 24
#
def inner():
#
return j
#
print eval("inner()")
func
()
print
i
print
eval
(
"(lambda k : k+2)(3)"
)
#
print eval("(lambda k : k+2)(3)")
l
=
100
print
eval
(
"(lambda k : l+2)(3)"
)
...
...
@@ -83,8 +81,9 @@ print eval("eval('3 + 2342')")
o
=
300
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
shadow2 = 1000
shadow3 = 1000
...
...
@@ -123,3 +122,4 @@ def wrap():
inner2()
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