mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-16806: Fix lineno
and col_offset
for multi-line string tokens (GH-10021)
This commit is contained in:
parent
1cffd0eed3
commit
995d9b9297
13 changed files with 91 additions and 51 deletions
|
@ -38,6 +38,8 @@ struct tok_state {
|
|||
int pendin; /* Pending indents (if > 0) or dedents (if < 0) */
|
||||
const char *prompt, *nextprompt; /* For interactive prompting */
|
||||
int lineno; /* Current line number */
|
||||
int first_lineno; /* First line of a single line or multi line string
|
||||
expression (cf. issue 16806) */
|
||||
int level; /* () [] {} Parentheses nesting level */
|
||||
/* Used to allow free continuations inside them */
|
||||
#ifndef PGEN
|
||||
|
@ -58,6 +60,9 @@ struct tok_state {
|
|||
char *encoding; /* Source encoding. */
|
||||
int cont_line; /* whether we are in a continuation line. */
|
||||
const char* line_start; /* pointer to start of current line */
|
||||
const char* multi_line_start; /* pointer to start of first line of
|
||||
a single line or multi line string
|
||||
expression (cf. issue 16806) */
|
||||
#ifndef PGEN
|
||||
PyObject *decoding_readline; /* open(...).readline */
|
||||
PyObject *decoding_buffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue