mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
bpo-42806: Fix ast locations of f-strings inside parentheses (GH-24067)
This commit is contained in:
parent
2ea320dddd
commit
bd2728b1e8
3 changed files with 56 additions and 1 deletions
|
@ -405,7 +405,7 @@ fstring_compile_expr(Parser *p, const char *expr_start, const char *expr_end,
|
|||
Parser *p2 = _PyPegen_Parser_New(tok, Py_fstring_input, p->flags, p->feature_version,
|
||||
NULL, p->arena);
|
||||
p2->starting_lineno = t->lineno + lines - 1;
|
||||
p2->starting_col_offset = p->tok->first_lineno == p->tok->lineno ? t->col_offset + cols : cols;
|
||||
p2->starting_col_offset = t->col_offset + cols;
|
||||
|
||||
expr = _PyPegen_run_parser(p2);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue