gh-97997: Add col_offset field to tokenizer and use that for AST nodes (#98000)

This commit is contained in:
Lysandros Nikolaou 2022-10-07 14:38:35 -07:00 committed by GitHub
parent c06276402b
commit 3de08ce8c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 11 deletions

View file

@ -57,6 +57,8 @@ struct tok_state {
int lineno; /* Current line number */
int first_lineno; /* First line of a single line or multi line string
expression (cf. issue 16806) */
int starting_col_offset; /* The column offset at the beginning of a token */
int col_offset; /* Current col offset */
int level; /* () [] {} Parentheses nesting level */
/* Used to allow free continuations inside them */
char parenstack[MAXLEVEL];