summaryrefslogtreecommitdiffstats
path: root/Tools/peg_generator/peg_extension
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-04-27 17:02:07 (GMT)
committerGitHub <noreply@github.com>2020-04-27 17:02:07 (GMT)
commit2b74c835a7280840a853e3a9aaeb83758b13a458 (patch)
treea8f64047d5872571e12d6c256bbc54a9551f8bb6 /Tools/peg_generator/peg_extension
parent9adccc1384568f4d46e37f698cb3e3a4f6ca0252 (diff)
downloadcpython-2b74c835a7280840a853e3a9aaeb83758b13a458.zip
cpython-2b74c835a7280840a853e3a9aaeb83758b13a458.tar.gz
cpython-2b74c835a7280840a853e3a9aaeb83758b13a458.tar.bz2
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.
Diffstat (limited to 'Tools/peg_generator/peg_extension')
-rw-r--r--Tools/peg_generator/peg_extension/peg_extension.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c
index d8d36a0..fb552ee 100644
--- a/Tools/peg_generator/peg_extension/peg_extension.c
+++ b/Tools/peg_generator/peg_extension/peg_extension.c
@@ -12,7 +12,6 @@ _build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *ar
} else {
result = Py_None;
Py_INCREF(result);
-
}
return result;
@@ -43,7 +42,8 @@ parse_file(PyObject *self, PyObject *args, PyObject *kwds)
goto error;
}
- mod_ty res = _PyPegen_run_parser_from_file(filename, Py_file_input, filename_ob, arena);
+ PyCompilerFlags flags = _PyCompilerFlags_INIT;
+ mod_ty res = _PyPegen_run_parser_from_file(filename, Py_file_input, filename_ob, &flags, arena);
if (res == NULL) {
goto error;
}
@@ -81,8 +81,9 @@ parse_string(PyObject *self, PyObject *args, PyObject *kwds)
goto error;
}
+ PyCompilerFlags flags = _PyCompilerFlags_INIT;
mod_ty res = _PyPegen_run_parser_from_string(the_string, Py_file_input, filename_ob,
- PyCF_IGNORE_COOKIE, arena);
+ &flags, arena);
if (res == NULL) {
goto error;
}