diff options
author | Ammar Askar <ammar@ammaraskar.com> | 2021-07-04 23:14:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-04 23:14:33 (GMT) |
commit | 5644c7b3ffd49bed58dc095be6e6148e0bb4431e (patch) | |
tree | c53063e2f78685d1f284f6e333e05f44e49ea5ca /Parser/pegen.h | |
parent | 693cec0e2dcafa393ed5cdaa606f8dc8e3876adf (diff) | |
download | cpython-5644c7b3ffd49bed58dc095be6e6148e0bb4431e.zip cpython-5644c7b3ffd49bed58dc095be6e6148e0bb4431e.tar.gz cpython-5644c7b3ffd49bed58dc095be6e6148e0bb4431e.tar.bz2 |
bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)
The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location
to print carets on the specific expressions involved in a traceback.
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Diffstat (limited to 'Parser/pegen.h')
-rw-r--r-- | Parser/pegen.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/pegen.h b/Parser/pegen.h index eac73bb..c09b4a2 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -139,6 +139,7 @@ expr_ty _PyPegen_name_token(Parser *p); expr_ty _PyPegen_number_token(Parser *p); void *_PyPegen_string_token(Parser *p); const char *_PyPegen_get_expr_name(expr_ty); +Py_ssize_t _PyPegen_byte_offset_to_character_offset(PyObject *line, Py_ssize_t col_offset); void *_PyPegen_raise_error(Parser *p, PyObject *errtype, const char *errmsg, ...); void *_PyPegen_raise_error_known_location(Parser *p, PyObject *errtype, Py_ssize_t lineno, Py_ssize_t col_offset, |