bpo-40334: Support CO_FUTURE_BARRY_AS_BDFL in the new parser (GH-19721)

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.
This commit is contained in:
Pablo Galindo 2020-04-27 18:02:07 +01:00 committed by GitHub
parent 9adccc1384
commit 2b74c835a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 578 additions and 468 deletions

View file

@ -241,7 +241,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename,
if (use_peg) {
mod = PyPegen_ASTFromFileObject(fp, filename, Py_single_input,
enc, ps1, ps2, &errcode, arena);
enc, ps1, ps2, flags, &errcode, arena);
}
else {
mod = PyParser_ASTFromFileObject(fp, filename, enc,
@ -1073,7 +1073,7 @@ PyRun_FileExFlags(FILE *fp, const char *filename_str, int start, PyObject *globa
if (use_peg) {
mod = PyPegen_ASTFromFileObject(fp, filename, start, NULL, NULL, NULL,
NULL, arena);
flags, NULL, arena);
}
else {
mod = PyParser_ASTFromFileObject(fp, filename, NULL, start, 0, 0,