cpython/Parser/pegen
Lysandros Nikolaou 3e0a6f37df
bpo-40334: Add support for feature_version in new PEG parser (GH-19827)
`ast.parse` and `compile` support a `feature_version` parameter that
tells the parser to parse the input string, as if it were written in
an older Python version.
The `feature_version` is propagated to the tokenizer, which uses it
to handle the three different stages of support for `async` and
`await`. Additionally, it disallows the following at parser level:
- The '@' operator in < 3.5
- Async functions in < 3.5
- Async comprehensions in < 3.6
- Underscores in numeric literals in < 3.6
- Await expression in < 3.5
- Variable annotations in < 3.6
- Async for-loops in < 3.5
- Async with-statements in < 3.5
- F-strings in < 3.6

Closes we-like-parsers/cpython#124.
2020-04-30 20:27:52 -07:00
..
parse.c bpo-40334: Add support for feature_version in new PEG parser (GH-19827) 2020-04-30 20:27:52 -07:00
parse_string.c bpo-40334: Add support for feature_version in new PEG parser (GH-19827) 2020-04-30 20:27:52 -07:00
parse_string.h bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503) 2020-04-22 23:29:27 +01:00
peg_api.c bpo-40334: Support CO_FUTURE_BARRY_AS_BDFL in the new parser (GH-19721) 2020-04-27 18:02:07 +01:00
pegen.c bpo-40334: Add support for feature_version in new PEG parser (GH-19827) 2020-04-30 20:27:52 -07:00
pegen.h bpo-40334: Add support for feature_version in new PEG parser (GH-19827) 2020-04-30 20:27:52 -07:00