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
b843cdb9
Commit
b843cdb9
authored
Feb 26, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '26453' into refcounting
parents
3bedca63
2645311f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
635 deletions
+11
-635
from_cpython/Lib/test/test_ast.py
from_cpython/Lib/test/test_ast.py
+0
-1
src/codegen/irgen/hooks.cpp
src/codegen/irgen/hooks.cpp
+9
-5
src/core/options.cpp
src/core/options.cpp
+1
-1
src/jit.cpp
src/jit.cpp
+1
-1
test/CPYTHON_TEST_NOTES.md
test/CPYTHON_TEST_NOTES.md
+0
-1
test/tests/test_ast.expected
test/tests/test_ast.expected
+0
-32
test/tests/test_ast.py
test/tests/test_ast.py
+0
-594
No files found.
from_cpython/Lib/test/test_ast.py
View file @
b843cdb9
# expected: fail
import
sys
,
itertools
,
unittest
from
test
import
test_support
import
ast
...
...
src/codegen/irgen/hooks.cpp
View file @
b843cdb9
...
...
@@ -497,9 +497,10 @@ Box* compile(Box* source, Box* fn, Box* type, Box** _args) {
AST
*
parsed
;
mod_ty
mod
;
ArenaWrapper
arena
;
if
(
PyAST_Check
(
source
))
{
int
mode
;
ArenaWrapper
arena
;
if
(
type_str
->
s
()
==
"exec"
)
mode
=
0
;
else
if
(
type_str
->
s
()
==
"eval"
)
...
...
@@ -509,10 +510,12 @@ Box* compile(Box* source, Box* fn, Box* type, Box** _args) {
else
{
raiseExcHelper
(
ValueError
,
"compile() arg 3 must be 'exec', 'eval' or 'single'"
);
}
if
(
only_ast
)
// nothing to do
return
source
;
mod
=
PyAST_obj2mod
(
source
,
arena
,
mode
);
if
(
PyErr_Occurred
())
throwCAPIException
();
parsed
=
cpythonToPystonAST
(
mod
,
filename_str
->
c_str
());
}
else
{
RELEASE_ASSERT
(
PyString_Check
(
source
),
""
);
int
mode
;
...
...
@@ -528,15 +531,12 @@ Box* compile(Box* source, Box* fn, Box* type, Box** _args) {
PyCompilerFlags
cf
;
cf
.
cf_flags
=
future_flags
;
ArenaWrapper
arena
;
const
char
*
code
=
static_cast
<
BoxedString
*>
(
source
)
->
s
().
data
();
assert
(
arena
);
const
char
*
fn
=
filename_str
->
c_str
();
mod
=
PyParser_ASTFromString
(
code
,
fn
,
mode
,
&
cf
,
arena
);
if
(
!
mod
)
throwCAPIException
();
parsed
=
cpythonToPystonAST
(
mod
,
filename_str
->
c_str
());
}
if
(
only_ast
)
{
...
...
@@ -547,6 +547,10 @@ Box* compile(Box* source, Box* fn, Box* type, Box** _args) {
return
result
;
}
// be careful when moving around this function: it does also do some additional syntax checking (=raises exception),
// which we should not do when in AST only mode.
parsed
=
cpythonToPystonAST
(
mod
,
filename_str
->
c_str
());
PyCompilerFlags
pcf
;
pcf
.
cf_flags
=
future_flags
;
...
...
src/core/options.cpp
View file @
b843cdb9
...
...
@@ -38,7 +38,7 @@ bool USE_STRIPPED_STDLIB = true; // always true
bool
ENABLE_INTERPRETER
=
false
;
// XXX
bool
ENABLE_BASELINEJIT
=
false
;
// XXX
bool
ENABLE_PYPA_PARSER
=
true
;
bool
ENABLE_CPYTHON_PARSER
=
fals
e
;
bool
ENABLE_CPYTHON_PARSER
=
tru
e
;
bool
USE_REGALLOC_BASIC
=
false
;
bool
PAUSE_AT_ABORT
=
false
;
bool
ENABLE_TRACEBACKS
=
true
;
...
...
src/jit.cpp
View file @
b843cdb9
...
...
@@ -220,7 +220,7 @@ int handleArg(char code) {
}
else
if
(
code
==
'x'
)
{
ENABLE_PYPA_PARSER
=
false
;
}
else
if
(
code
==
'X'
)
{
ENABLE_CPYTHON_PARSER
=
tru
e
;
ENABLE_CPYTHON_PARSER
=
fals
e
;
}
else
if
(
code
==
'E'
)
{
Py_IgnoreEnvironmentFlag
=
1
;
}
else
if
(
code
==
'P'
)
{
...
...
test/CPYTHON_TEST_NOTES.md
View file @
b843cdb9
...
...
@@ -24,7 +24,6 @@ test_al No module named al
test_applesingle Not really a failure, but it tries to skip itself and we don't support that
test_argparse [unknown]
test_ascii_formatd segfault in ctypes (but only on CI)
test_ast mismatch of parser error checks. remove test/tests/test_ast.py when the orig test passes
test_asynchat [unknown]
test_asyncore [unknown]
test_atexit [unknown]
...
...
test/tests/test_ast.expected
deleted
100644 → 0
View file @
3bedca63
test_AST_objects (__main__.AST_Tests) ... ok
test_arguments (__main__.AST_Tests) ... ok
test_base_classes (__main__.AST_Tests) ... ok
test_classattrs (__main__.AST_Tests) ... ok
test_field_attr_existence (__main__.AST_Tests) ... ok
test_field_attr_writable (__main__.AST_Tests) ... ok
test_from_import (__main__.AST_Tests) ... ok
test_invalid_identitifer (__main__.AST_Tests) ... ok
test_invalid_string (__main__.AST_Tests) ... ok
test_module (__main__.AST_Tests) ... ok
test_no_fields (__main__.AST_Tests) ... ok
test_nodeclasses (__main__.AST_Tests) ... ok
test_non_interned_future_from_ast (__main__.AST_Tests) ... ok
test_pickling (__main__.AST_Tests) ... skipped 'parse error'
test_slice (__main__.AST_Tests) ... ok
test_snippets (__main__.AST_Tests) ... skipped 'parse error'
test_copy_location (__main__.ASTHelpers_Test) ... ok
test_dump (__main__.ASTHelpers_Test) ... ok
test_fix_missing_locations (__main__.ASTHelpers_Test) ... ok
test_get_docstring (__main__.ASTHelpers_Test) ... ok
test_increment_lineno (__main__.ASTHelpers_Test) ... ok
test_iter_child_nodes (__main__.ASTHelpers_Test) ... ok
test_iter_fields (__main__.ASTHelpers_Test) ... ok
test_literal_eval (__main__.ASTHelpers_Test) ... ok
test_literal_eval_issue4907 (__main__.ASTHelpers_Test) ... ok
test_parse (__main__.ASTHelpers_Test) ... ok
----------------------------------------------------------------------
Ran 26 tests in TIME
OK (skipped=2)
test/tests/test_ast.py
deleted
100644 → 0
View file @
3bedca63
This diff is collapsed.
Click to expand it.
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