diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-11-24 22:21:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 22:21:23 (GMT) |
commit | 24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1 (patch) | |
tree | bcd92d5aa5eb38532813cd703dc7f728d20d230a /Parser/pegen.c | |
parent | f4afc53bf68c8ded20b281cd1baa88a679b4a3fd (diff) | |
download | cpython-24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1.zip cpython-24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1.tar.gz cpython-24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1.tar.bz2 |
bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if inside parentheses (GH-29757)
Diffstat (limited to 'Parser/pegen.c')
-rw-r--r-- | Parser/pegen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c index 4f51c63..ede281a 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -170,6 +170,8 @@ initialize_token(Parser *p, Token *token, const char *start, const char *end, in return -1; } + token->level = p->tok->level; + const char *line_start = token_type == STRING ? p->tok->multi_line_start : p->tok->line_start; int lineno = token_type == STRING ? p->tok->first_lineno : p->tok->lineno; int end_lineno = p->tok->lineno; @@ -946,4 +948,4 @@ _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filen error: _PyTokenizer_Free(tok); return result; -}
\ No newline at end of file +} |