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
c00a745e
Commit
c00a745e
authored
Jan 13, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compile: Don't check for ''break' outside loop' error when in AST only mode
parent
3a81033b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
633 deletions
+9
-633
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
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 @
c00a745e
# expected: fail
import
sys
,
itertools
,
unittest
from
test
import
test_support
import
ast
...
...
src/codegen/irgen/hooks.cpp
View file @
c00a745e
...
...
@@ -490,9 +490,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"
)
...
...
@@ -502,10 +503,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
;
...
...
@@ -521,15 +524,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
)
{
...
...
@@ -540,6 +540,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
;
...
...
test/CPYTHON_TEST_NOTES.md
View file @
c00a745e
...
...
@@ -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 @
3a81033b
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 @
3a81033b
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