summaryrefslogtreecommitdiffstats
path: root/Parser/peg_api.c
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2023-10-13 09:25:37 (GMT)
committerGitHub <noreply@github.com>2023-10-13 09:25:37 (GMT)
commite1d8c65e1df990ef8d61b8912742e1a021395e78 (patch)
tree84956c1158b3baf33d9836a5a87b8fa6b57a0428 /Parser/peg_api.c
parent898f531996f2c5399b13811682c578c4fd08afaa (diff)
downloadcpython-e1d8c65e1df990ef8d61b8912742e1a021395e78.zip
cpython-e1d8c65e1df990ef8d61b8912742e1a021395e78.tar.gz
cpython-e1d8c65e1df990ef8d61b8912742e1a021395e78.tar.bz2
gh-110805: Allow the repl to show source code and complete tracebacks (#110775)
Diffstat (limited to 'Parser/peg_api.c')
-rw-r--r--Parser/peg_api.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/Parser/peg_api.c b/Parser/peg_api.c
index 447f566..d4acc3e 100644
--- a/Parser/peg_api.c
+++ b/Parser/peg_api.c
@@ -23,5 +23,18 @@ _PyParser_ASTFromFile(FILE *fp, PyObject *filename_ob, const char *enc,
return NULL;
}
return _PyPegen_run_parser_from_file_pointer(fp, mode, filename_ob, enc, ps1, ps2,
- flags, errcode, arena);
+ flags, errcode, NULL, arena);
}
+
+mod_ty
+_PyParser_InteractiveASTFromFile(FILE *fp, PyObject *filename_ob, const char *enc,
+ int mode, const char *ps1, const char* ps2,
+ PyCompilerFlags *flags, int *errcode,
+ PyObject **interactive_src, PyArena *arena)
+{
+ if (PySys_Audit("compile", "OO", Py_None, filename_ob) < 0) {
+ return NULL;
+ }
+ return _PyPegen_run_parser_from_file_pointer(fp, mode, filename_ob, enc, ps1, ps2,
+ flags, errcode, interactive_src, arena);
+} \ No newline at end of file