Commit Graph

14 Commits

Author SHA1 Message Date
Victor Stinner 1def7754b7
bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)
* Rename PyConfig.use_peg to _use_peg_parser
* Document PyConfig._use_peg_parser and mark it a deprecated
* Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated
  in the documentation.
* Add use_old_parser() and skip_if_new_parser() to test.support
* Remove sys.flags.use_peg: use_old_parser() uses
  _testinternalcapi.get_configs() instead.
* Enhance test_embed tests
* subprocess._args_from_interpreter_flags() copies -X oldparser
2020-04-23 03:03:24 +02:00
Pablo Galindo c5fc156852
bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-04-22 23:29:27 +01:00
Hakan Çelik 6a5bf15c71
bpo-40209: Use tokenize.open in test_unparse (GH-19399) 2020-04-16 11:11:55 +01:00
Batuhan Taşkaya 5b66ec166b
bpo-38870: Implement support for ast.FunctionType in ast.unparse (GH-19016) 2020-03-15 19:56:57 +00:00
Batuhan Taşkaya e7cab7f780
bpo-38870: Simplify sequence interleaves in ast.unparse (GH-17892) 2020-03-09 20:27:03 +00:00
Serhiy Storchaka c4928fc1a8
bpo-39889: Fix ast.unparse() for subscript. (GH-18824) 2020-03-07 17:25:32 +02:00
Batuhan Taşkaya 89aa4694fc
bpo-38870: Add docstring support to ast.unparse (GH-17760)
Allow ast.unparse to detect docstrings in functions, modules and classes and produce
nicely formatted unparsed output for said docstrings.

Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
2020-03-02 18:59:01 +00:00
Batuhan Taşkaya 397b96f6d7
bpo-38870: Implement a precedence algorithm in ast.unparse (GH-17377)
Implement a simple precedence algorithm for ast.unparse in order to avoid redundant
parenthesis for nested structures in the final output.
2020-03-01 20:12:17 +00:00
Batuhan Taşkaya 7b35bef978 bpo-38870: Throw ValueError on invalid yield from usage (GH-17798) 2020-01-02 18:20:04 +00:00
Pablo Galindo be287c3191
Fix error when running with -uall in test_unparse (GH-17739) 2019-12-29 20:18:36 +00:00
Pablo Galindo 23a226bf3a
bpo-38870: Run always tests that heavily use grammar features in test_unparse (GH-17738) 2019-12-29 19:20:55 +00:00
Pablo Galindo e9df88e8e9
Clean imports in test_unparse (GH-17545) 2019-12-10 00:37:47 +00:00
Pablo Galindo ac229116a3
bpo-39003: Make sure all test are the same when using -R in test_unparse (GH-17537) 2019-12-09 17:57:50 +00:00
Pablo Galindo 27fc3b6f3f
bpo-38870: Expose a function to unparse an ast object in the ast module (GH-17302)
Add ast.unparse() as a function in the ast module that can be used to unparse an
ast.AST object and produce a string with code that would produce an equivalent ast.AST
object when parsed.
2019-11-24 23:02:40 +00:00