summaryrefslogtreecommitdiffstats
path: root/Modules/_peg_parser.c
Commit message (Collapse)AuthorAgeFilesLines
* Refactor scripts in Tools/peg_generator/scripts (GH-20401)Miss Islington (bot)2020-06-061-4/+12
| | | | | (cherry picked from commit ba6fd87e41dceb01dcdacc57c722aca12cde42a9) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-40688: Use the correct parser in the peg_generator scripts (GH-20235)Miss Islington (bot)2020-05-251-52/+81
| | | | | | | | | | The scripts in `Tools/peg_generator/scripts` mostly assume that `ast.parse` and `compile` use the old parser, since this was the state of things, while we were developing them. They need to be updated to always use the correct parser. `_peg_parser` is being extended to support both parsing and compiling with both parsers. (cherry picked from commit 9645930b5bc1833ef495891d22052d1ba65ab7ea) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-40334: Make the PyPegen* and PyParser* APIs more consistent (GH-19839)Lysandros Nikolaou2020-05-011-2/+2
| | | | | | | | | This commit makes both APIs more consistent by doing the following: - Remove the `PyPegen_CodeObjectFrom*` functions, which weren't used and will probably not be needed. Functions like `Py_CompileStringObject` can be used instead. - Include a `const char *filename` parameter in `PyPegen_ASTFromString`. - Rename `PyPegen_ASTFromFile` to `PyPegen_ASTFromFilename`, because its signature is not the same with `PyParser_ASTFromFile`.
* bpo-40334: Fix test_peg_parser to actually use the old parser (GH-19778)Lysandros Nikolaou2020-04-291-3/+11
| | | Now that the default parser is the new PEG parser, ast.parse uses it, which means that we don't actually test something in test_peg_parser. This commit introduces a new keyword argument (`oldparser`) for `_peg_parser.parse_string` for specifying that a string needs to be parsed with the old parser. This keyword argument is used in the tests to actually compare the ASTs the new parser generates with those generated by the old parser.
* bpo-40334: Support CO_FUTURE_BARRY_AS_BDFL in the new parser (GH-19721)Pablo Galindo2020-04-271-1/+2
| | | This commit also allows to pass flags to the new parser in all interfaces and fixes a bug in the parser generator that was causing to inline rules with actions, making them disappear.
* bpo-40334: Improve various PEG-Parser related stuff (GH-19669)Lysandros Nikolaou2020-04-231-1/+1
| | | The changes in this commit are all related to @vstinner's original review comments of the initial PEP 617 implementation PR.
* bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)Pablo Galindo2020-04-221-0/+107
Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>